source: trunk/poppler/mypoppler/poppler/OptionalContent.h @ 261

Last change on this file since 261 was 261, checked in by Eugene Romanenko, 13 years ago

PDF plugin: Poppler library updated to version 0.10.2

File size: 1.9 KB
Line 
1//========================================================================
2//
3// OptionalContent.h
4//
5// Copyright 2007 Brad Hards <bradh@kde.org>
6// Copyright 2008 Carlos Garcia Campos <carlosgc@gnome.org>
7//
8// Released under the GPL (version 2, or later, at your option)
9//
10//========================================================================
11
12#ifndef OPTIONALCONTENT_H
13#define OPTIONALCONTENT_H
14
15#ifdef USE_GCC_PRAGMAS
16#pragma interface
17#endif
18
19#include "Object.h"
20#include "CharTypes.h"
21
22class GooString;
23class GooList;
24class XRef;
25
26class OptionalContentGroup; 
27
28//------------------------------------------------------------------------
29
30class OCGs {
31public:
32
33  OCGs(Object *ocgObject, XRef *xref);
34  ~OCGs();
35
36  // Is OCGS valid?
37  GBool isOk() { return ok; }
38 
39  bool hasOCGs();
40  GooList *getOCGs() const { return optionalContentGroups; }
41
42  OptionalContentGroup* findOcgByRef( const Ref &ref);
43
44  Array* getOrderArray() 
45    { return (order.isArray() && order.arrayGetLength() > 0) ? order.getArray() : NULL; }
46  Array* getRBGroupsArray() 
47    { return (rbgroups.isArray() && rbgroups.arrayGetLength()) ? rbgroups.getArray() : NULL; }
48
49  bool optContentIsVisible( Object *dictRef );
50
51private:
52  GBool ok;
53 
54  bool allOn( Array *ocgArray );
55  bool allOff( Array *ocgArray );
56  bool anyOn( Array *ocgArray );
57  bool anyOff( Array *ocgArray );
58
59  GooList *optionalContentGroups;
60
61  Object order;
62  Object rbgroups;
63  XRef *m_xref;
64};
65
66//------------------------------------------------------------------------
67
68class OptionalContentGroup {
69public:
70  enum State { On, Off };
71
72  OptionalContentGroup(Dict *dict);
73
74  OptionalContentGroup(GooString *label);
75
76  ~OptionalContentGroup();
77
78  GooString* getName() const;
79
80  Ref getRef() const;
81  void setRef(const Ref ref);
82
83  State getState() { return m_state; };
84  void setState(State state) { m_state = state; };
85
86private:
87  XRef *xref;
88  GooString *m_name;
89  Ref m_ref;
90  State m_state; 
91};
92
93#endif
Note: See TracBrowser for help on using the repository browser.