Changeset View
Changeset View
Standalone View
Standalone View
core/form.h
1 | /*************************************************************************** | 1 | /*************************************************************************** | ||
---|---|---|---|---|---|
2 | * Copyright (C) 2007 by Pino Toscano <pino@kde.org> * | 2 | * Copyright (C) 2007 by Pino Toscano <pino@kde.org> * | ||
3 | * * | 3 | * * | ||
4 | * This program is free software; you can redistribute it and/or modify * | 4 | * This program is free software; you can redistribute it and/or modify * | ||
5 | * it under the terms of the GNU General Public License as published by * | 5 | * it under the terms of the GNU General Public License as published by * | ||
6 | * the Free Software Foundation; either version 2 of the License, or * | 6 | * the Free Software Foundation; either version 2 of the License, or * | ||
7 | * (at your option) any later version. * | 7 | * (at your option) any later version. * | ||
8 | ***************************************************************************/ | 8 | ***************************************************************************/ | ||
9 | 9 | | |||
10 | #ifndef _OKULAR_FORM_H_ | 10 | #ifndef _OKULAR_FORM_H_ | ||
11 | #define _OKULAR_FORM_H_ | 11 | #define _OKULAR_FORM_H_ | ||
12 | 12 | | |||
13 | #include "okularcore_export.h" | 13 | #include "okularcore_export.h" | ||
14 | #include "area.h" | 14 | #include "area.h" | ||
15 | #include "annotations.h" | 15 | #include "annotations.h" | ||
16 | #include "signatureinfo.h" | ||||
16 | 17 | | |||
17 | #include <QtCore/QStringList> | 18 | #include <QtCore/QStringList> | ||
18 | 19 | | |||
19 | namespace Okular { | 20 | namespace Okular { | ||
20 | 21 | | |||
21 | class Action; | 22 | class Action; | ||
22 | class Page; | 23 | class Page; | ||
23 | class PagePrivate; | 24 | class PagePrivate; | ||
24 | class FormFieldPrivate; | 25 | class FormFieldPrivate; | ||
25 | class FormFieldButtonPrivate; | 26 | class FormFieldButtonPrivate; | ||
26 | class FormFieldTextPrivate; | 27 | class FormFieldTextPrivate; | ||
27 | class FormFieldChoicePrivate; | 28 | class FormFieldChoicePrivate; | ||
29 | class FormFieldSignaturePrivate; | ||||
28 | 30 | | |||
29 | /** | 31 | /** | ||
30 | * @short The base interface of a form field. | 32 | * @short The base interface of a form field. | ||
31 | * | 33 | * | ||
32 | * This is the very basic interface to represent a field in a form. | 34 | * This is the very basic interface to represent a field in a form. | ||
33 | * | 35 | * | ||
34 | * This is not meant to be used as a direct base for the form fields in a | 36 | * This is not meant to be used as a direct base for the form fields in a | ||
35 | * document, but its abstract subclasses are. | 37 | * document, but its abstract subclasses are. | ||
▲ Show 20 Lines • Show All 346 Lines • ▼ Show 20 Line(s) | 306 | { | |||
382 | protected: | 384 | protected: | ||
383 | FormFieldChoice(); | 385 | FormFieldChoice(); | ||
384 | 386 | | |||
385 | private: | 387 | private: | ||
386 | Q_DECLARE_PRIVATE( FormFieldChoice ) | 388 | Q_DECLARE_PRIVATE( FormFieldChoice ) | ||
387 | Q_DISABLE_COPY( FormFieldChoice ) | 389 | Q_DISABLE_COPY( FormFieldChoice ) | ||
388 | }; | 390 | }; | ||
389 | 391 | | |||
392 | /** | ||||
393 | * @short Interface of a signature form field. | ||||
394 | * | ||||
395 | * This is the base interface to reimplement to represent a signature field. | ||||
396 | */ | ||||
397 | class OKULARCORE_EXPORT FormFieldSignature : public FormField | ||||
398 | { | ||||
399 | public: | ||||
400 | /** | ||||
401 | * The types of signature. | ||||
402 | */ | ||||
403 | enum SignatureType { | ||||
404 | AdbePkcs7sha1, | ||||
405 | AdbePkcs7detached, | ||||
406 | EtsiCAdESdetached, | ||||
407 | UnknownType | ||||
408 | }; | ||||
409 | | ||||
410 | ~FormFieldSignature(); | ||||
411 | | ||||
412 | /** | ||||
413 | * The signature type | ||||
414 | */ | ||||
415 | virtual SignatureType signatureType() const = 0; | ||||
aacid: What would be the usecase for this force? | |||||
I never thought of a possible use case before duplicating it here. For now I have removed it from the patch. I will update this diff if I find any use case. chinmoyr: I never thought of a possible use case before duplicating it here. For now I have removed it… | |||||
416 | | ||||
417 | /** | ||||
418 | * Validate the signature with 'now' as validation time. | ||||
419 | * | ||||
420 | */ | ||||
421 | virtual SignatureInfo* validate() const = 0; | ||||
422 | | ||||
423 | | ||||
424 | protected: | ||||
425 | FormFieldSignature(); | ||||
426 | | ||||
427 | private: | ||||
428 | Q_DECLARE_PRIVATE( FormFieldSignature ) | ||||
429 | Q_DISABLE_COPY( FormFieldSignature ) | ||||
430 | }; | ||||
a map of strings to variants is not very good API since basically it can have any random things in there. So as a consumer of that API you're blind. Wouldn't a class/structure make sense here? aacid: a map of strings to variants is not very good API since basically it can have any random things… | |||||
431 | | ||||
390 | } | 432 | } | ||
391 | 433 | | |||
392 | #endif | 434 | #endif | ||
As a viewer when would we need to have a different validation time than now? aacid: As a viewer when would we need to have a different validation time than now?
| |||||
Same here. Never actually thought of a use case and still can't find one. chinmoyr: Same here. Never actually thought of a use case and still can't find one. |
What would be the usecase for this force?