• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

kig

  • sources
  • kde-4.12
  • kdeedu
  • kig
  • misc
lists.h
Go to the documentation of this file.
1 // Copyright (C) 2003 Dominique Devriese <devriese@kde.org>
2 
3 // This program is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU General Public License
5 // as published by the Free Software Foundation; either version 2
6 // of the License, or (at your option) any later version.
7 
8 // This program is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 // GNU General Public License for more details.
12 
13 // You should have received a copy of the GNU General Public License
14 // along with this program; if not, write to the Free Software
15 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
16 // 02110-1301, USA.
17 
18 #ifndef KIG_MISC_LISTS_H
19 #define KIG_MISC_LISTS_H
20 
21 #include <vector>
22 #include <set>
23 
24 class GUIAction;
25 class ObjectConstructor;
26 class MacroConstructor;
27 class KigDocument;
28 class KigPart;
29 class KigWidget;
30 class QString;
31 class QDomElement;
32 class ObjectCalcer;
33 
38 class GUIActionList
39 {
40 public:
41  typedef std::set<GUIAction*> avectype;
42  typedef std::set<KigPart*> dvectype;
43 private:
44  avectype mactions;
45  dvectype mdocs;
46  GUIActionList();
47  ~GUIActionList();
48 public:
49  static GUIActionList* instance();
50  const avectype& actions() const { return mactions; }
51 
56  void regDoc( KigPart* d );
57  void unregDoc( KigPart* d );
58 
59  void add( GUIAction* a );
60  void add( const std::vector<GUIAction*>& a );
61  void remove( GUIAction* a );
62  void remove( const std::vector<GUIAction*>& a );
63 };
64 
69 class ObjectConstructorList
70 {
71 public:
72  typedef std::vector<ObjectConstructor*> vectype;
73 private:
74  vectype mctors;
75  ObjectConstructorList();
76  ~ObjectConstructorList();
77 public:
78  static ObjectConstructorList* instance();
79  void add( ObjectConstructor* a );
80  void remove( ObjectConstructor* a );
81  vectype ctorsThatWantArgs( const std::vector<ObjectCalcer*>&, const KigDocument&,
82  const KigWidget&, bool completeOnly = false
83  ) const;
84  const vectype& constructors() const;
85 };
86 
91 class Macro
92 {
93 public:
94  GUIAction* action;
95  MacroConstructor* ctor;
96  Macro( GUIAction* a, MacroConstructor* c );
97  ~Macro();
98 };
99 
103 bool operator==( const Macro& l, const Macro& r );
104 
110 class MacroList
111 {
112 public:
113  typedef std::vector<Macro*> vectype;
114 private:
115  vectype mdata;
116  MacroList();
117  ~MacroList();
118 public:
122  static MacroList* instance();
123 
128  void add( Macro* m );
133  void add( const vectype& ms );
134 
139  void remove( Macro* m );
140 
144  bool save( Macro* m, const QString& f );
148  bool save( const vectype& ms, const QString& f );
149 
159  bool load( const QString& f, vectype& ret, const KigPart& );
160 
164  const vectype& macros() const;
165 
166 private:
167  bool loadNew( const QDomElement& docelem, std::vector<Macro*>& ret, const KigPart& );
168 };
169 
170 #endif
GUIActionList
List of GUIActions for the parts to show.
Definition: lists.h:38
Macro::~Macro
~Macro()
Definition: lists.cc:236
MacroList::macros
const vectype & macros() const
get access to the list of macro's.
Definition: lists.cc:231
Macro::Macro
Macro(GUIAction *a, MacroConstructor *c)
Definition: lists.cc:160
GUIActionList::regDoc
void regDoc(KigPart *d)
register this document, so that it receives notifications for added and removed actions.
Definition: lists.cc:58
ObjectConstructorList
The list of object constructors for use in various places, e.g.
Definition: lists.h:69
Macro::action
GUIAction * action
Definition: lists.h:94
GUIActionList::unregDoc
void unregDoc(KigPart *d)
Definition: lists.cc:63
GUIActionList::dvectype
std::set< KigPart * > dvectype
Definition: lists.h:42
ObjectConstructorList::add
void add(ObjectConstructor *a)
Definition: lists.cc:155
Macro::ctor
MacroConstructor * ctor
Definition: lists.h:95
ObjectConstructorList::ctorsThatWantArgs
vectype ctorsThatWantArgs(const std::vector< ObjectCalcer * > &, const KigDocument &, const KigWidget &, bool completeOnly=false) const
Definition: lists.cc:135
ObjectConstructor
This class represents a way to construct a set of objects from a set of other objects.
Definition: object_constructor.h:44
MacroList::add
void add(Macro *m)
Add a Macro m .
Definition: lists.cc:213
MacroConstructor
MacroConstructor is a class that represents Kig macro's: these are constructed by the user...
Definition: object_constructor.h:336
ObjectCalcer
An ObjectCalcer is an object that represents an algorithm for calculating an ObjectImp from other Obj...
Definition: object_calcer.h:66
KigWidget
This class is the real widget showing the document.
Definition: kig_view.h:50
ObjectConstructorList::instance
static ObjectConstructorList * instance()
Definition: lists.cc:129
ObjectConstructorList::vectype
std::vector< ObjectConstructor * > vectype
Definition: lists.h:72
ObjectConstructorList::constructors
const vectype & constructors() const
Definition: lists.cc:392
MacroList::vectype
std::vector< Macro * > vectype
Definition: lists.h:113
operator==
bool operator==(const Macro &l, const Macro &r)
a simply equality operator for Macro class.
Definition: lists.cc:165
MacroList
This class keeps a list of all macro's, and allows them to be easily accessed, added etc...
Definition: lists.h:110
GUIActionList::avectype
std::set< GUIAction * > avectype
Definition: lists.h:41
MacroList::save
bool save(Macro *m, const QString &f)
Save macro m to file f .
Definition: lists.cc:240
Macro
this is just a simple data struct.
Definition: lists.h:91
MacroList::load
bool load(const QString &f, vectype &ret, const KigPart &)
load macro's from file f .
Definition: lists.cc:298
KigDocument
KigDocument is the class holding the real data in a Kig document.
Definition: kig_document.h:36
GUIActionList::instance
static GUIActionList * instance()
Definition: lists.cc:42
KigPart
This is a "Part".
Definition: kig_part.h:68
GUIActionList::add
void add(GUIAction *a)
Definition: lists.cc:80
GUIAction
Definition: guiaction.h:51
GUIActionList::actions
const avectype & actions() const
Definition: lists.h:50
MacroList::instance
static MacroList * instance()
MacroList is a singleton.
Definition: lists.cc:195
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:35:39 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

kig

Skip menu "kig"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal