Source Code Cross Referenced for AcroFormSigFlags.java in  » PDF » jPod » de » intarsys » pdf » pd » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » PDF » jPod » de.intarsys.pdf.pd 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (c) 2007, intarsys consulting GmbH
003:         *
004:         * Redistribution and use in source and binary forms, with or without
005:         * modification, are permitted provided that the following conditions are met:
006:         *
007:         * - Redistributions of source code must retain the above copyright notice,
008:         *   this list of conditions and the following disclaimer.
009:         *
010:         * - Redistributions in binary form must reproduce the above copyright notice,
011:         *   this list of conditions and the following disclaimer in the documentation
012:         *   and/or other materials provided with the distribution.
013:         *
014:         * - Neither the name of intarsys nor the names of its contributors may be used
015:         *   to endorse or promote products derived from this software without specific
016:         *   prior written permission.
017:         *
018:         * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
019:         * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
020:         * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
021:         * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
022:         * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
023:         * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
024:         * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
025:         * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
026:         * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
027:         * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
028:         * POSSIBILITY OF SUCH DAMAGE.
029:         */
030:        package de.intarsys.pdf.pd;
031:
032:        /**
033:         * The flags of a signature field.
034:         * <p>
035:         * The flags are bits of an integer.<br>
036:         * The following bits are defined (more may exist).
037:         * </p>
038:         * <ul>
039:         * <li>0: default
040:         * <li>1: SignatureExists
041:         * <li>2: AppendOnly
042:         * </ul>
043:         */
044:        public class AcroFormSigFlags extends AbstractBitFlags {
045:            static public int Bit_SignatureExists = 1; // Bit position 1
046:
047:            static public int Bit_AppendOnly = 1 << 1; // Bit position 2
048:
049:            private PDAcroForm acroForm;
050:
051:            public AcroFormSigFlags(PDAcroForm form) {
052:                acroForm = form;
053:            }
054:
055:            /**
056:             * excerpt from PDF 1.7 spec (p. 674):
057:             * <p>
058:             * If set, the document contains signatures that may be invalidated if the
059:             * file is saved (written) in a way that alters its previous contents, as
060:             * opposed to an incremental update. Merely updating the file by appending
061:             * new information to the end of the previous version is safe (see Section
062:             * G.6, “Updating Example”). Viewer applications can use this flag to
063:             * present a user requesting a full save with an additional alert box
064:             * warning that signatures will be invalidated and requiring explicit
065:             * confirmation before continuing with the operation.
066:             * <p>
067:             * 
068:             * @param appendOnly
069:             */
070:            public void setAppendOnly(boolean appendOnly) {
071:                set(Bit_AppendOnly, appendOnly);
072:            }
073:
074:            /**
075:             * @see de.intarsys.pdf.pd.AcroFormSigFlags#setAppendOnly(boolean)
076:             * 
077:             * @return appendOnly flag
078:             */
079:            public boolean isAppendOnly() {
080:                return isSetAnd(Bit_AppendOnly);
081:            }
082:
083:            /**
084:             * excerpt from PDF 1.7 spec (p. 674):
085:             * <p>
086:             * If set, the document contains at least one signature field. This flag
087:             * allows a viewer application to enable user interface items (such as menu
088:             * items or pushbuttons) related to signature processing without having to
089:             * scan the entire document for the presence of signature fields.
090:             * </p>
091:             * 
092:             * @param signatureExists
093:             */
094:            public void setSignatureExists(boolean signatureExists) {
095:                set(Bit_SignatureExists, signatureExists);
096:            }
097:
098:            /**
099:             * @see de.intarsys.pdf.pd.AcroFormSigFlags#setSignatureExists(boolean)
100:             * 
101:             * @return signatureExists flag
102:             */
103:            public boolean isSignatureExists() {
104:                return isSetAnd(Bit_SignatureExists);
105:            }
106:
107:            protected PDAcroForm getAcroForm() {
108:                return acroForm;
109:            }
110:
111:            protected void setValue(int newValue) {
112:                if (newValue != 0) { // default
113:                    getAcroForm().setFieldInt(PDAcroForm.DK_SigFlags, newValue);
114:                } else {
115:                    getAcroForm().cosRemoveField(PDAcroForm.DK_SigFlags);
116:                }
117:            }
118:
119:            protected int getValue() {
120:                return getAcroForm().getFieldInt(PDAcroForm.DK_SigFlags, 0);
121:            }
122:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.