The Gnome Chemistry Utils  0.14.0
gcp/brackets.h
Go to the documentation of this file.
1 // -*- C++ -*-
2 
3 /*
4  * GChemPaint library
5  * brackets.h
6  *
7  * Copyright (C) 2010-2012 Jean Bréfort <jean.brefort@normalesup.org>
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License as
11  * published by the Free Software Foundation; either version 3 of the
12  * License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
22  * USA
23  */
24 
25 #ifndef GCHEMPAINT_BRACKETS_H
26 #define GCHEMPAINT_BRACKETS_H
27 
28 #include <gcu/object.h>
29 #include <gccv/item-client.h>
30 #include <gccv/brackets.h>
31 #include <set>
32 
34 namespace gcp {
35 
36 extern gcu::TypeId BracketsType;
37 
44 typedef enum {
62 
69 typedef enum {
83 
90 class Brackets: public gcu::Object, public gccv::ItemClient
91 {
92 public:
102  virtual ~Brackets();
103 
104 
108  void AddItem ();
109 
117  bool Load (xmlNodePtr node);
123  xmlNodePtr Save (xmlDocPtr xml) const;
131  void SetSelected (int state);
135  void OnLoaded ();
136 
143  void OnUnlink (Object *object);
152  bool BuildContextualMenu (gcu::UIManager *UIManager, Object *object, double x, double y);
153 
159  void SetEmbeddedObjects (std::set < gcu::Object * > objects);
160 
164  std::set < gcu::Object * > const &GetEmbeddedObjects () {return m_EmbeddedObjects;}
165 
171  static bool ConnectedAtoms (std::set < gcu::Object * > const &objects);
181  void Transform2D (gcu::Matrix2D& m, double x, double y);
182 
183 private:
184  std::set < gcu::Object * > m_EmbeddedObjects;
185  bool m_Valid;
186  BracketContent m_Content;
187 
200 
201 
212 GCU_PROP (gccv::BracketsUses, Used)
213 
218 GCU_RO_PROP (unsigned, Decorations)
219 
231 GCU_PROP (std::string, FontDesc)
232 };
233 
234 } // namespace gcp
235 
236 #endif //GCHEMPAINT_BRACKETS_H