Context.h

Go to the documentation of this file.
00001 //---------------------------------------------------------------------------------------
00002 // Copyright (c) 2001-2008 by PDFTron Systems Inc. All Rights Reserved.
00003 // Consult legal.txt regarding legal and license information.
00004 //---------------------------------------------------------------------------------------
00005 
00006 #ifndef   H_CPPPDFOCGContext
00007 #define   H_CPPPDFOCGContext
00008 
00009 #include <SDF/Obj.h>
00010 #include <C/PDF/OCG/TRN_OCGContext.h>
00011 
00012 namespace pdftron { 
00013         namespace PDF {
00014                 namespace OCG {
00015 
00041 class Context
00042 {
00043 public: 
00044 
00049         Context(const Context& context);
00050         Context& operator=(const Context& g);
00051 
00058         Context(const class Config& config);
00059 
00063         ~Context();
00064 
00068         bool IsValid() const { return mp_obj!=0; }
00069 
00076         bool GetState(const class Group& group) const;
00077 
00084         void SetState(const class Group& group, bool state);
00085 
00091         void ResetStates(bool all_on);
00092 
00093         /*
00094          * Sets the non-OC status for this context. Content that is not marked 
00095          * as optional content is drawn (or element.IsOCVisible()) when 'draw_non_OC' 
00096          * is true, and not drawn/visible otherwise.
00097          *
00098          * @param draw_non_OC A flag specifying whether the content that is not 
00099          * marked as optional should be treated as visible.
00100          */
00101         void SetNonOCDrawing(bool draw_non_OC);
00102 
00108         bool GetNonOCDrawing() const;
00109 
00124         enum OCDrawMode
00125         {
00131                 e_VisibleOC,
00132 
00137                 e_AllOC,
00138 
00143                 e_NoOC
00144         };
00145 
00153         void SetOCDrawMode(OCDrawMode oc_draw_mode);
00154 
00159         OCDrawMode GetOCMode() const;
00160 
00161 
00163         Context(TRN_OCGContext ctx);
00164         TRN_OCGContext mp_obj;
00165 private:
00166         bool m_owner;
00168 };
00169 
00170                 };      // namespace OCG
00171         };      // namespace PDF
00172 };      // namespace pdftron
00173 
00174 #endif
00175 

© 2002-2008 PDFTron Systems Inc.