Laxkit  0.0.7.1
tagged.h
1 //
2 //
3 // The Laxkit, a windowing toolkit
4 // Please consult http://laxkit.sourceforge.net about where to send any
5 // correspondence about this software.
6 //
7 // This library is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU Library General Public
9 // License as published by the Free Software Foundation; either
10 // version 2 of the License, or (at your option) any later version.
11 //
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 // Library General Public License for more details.
16 //
17 // You should have received a copy of the GNU Library General Public
18 // License along with this library; if not, write to the Free Software
19 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 //
21 // Copyright (c) 2010 Tom Lechner
22 //
23 #ifndef _LAXKIT_TAGGED_H
24 #define _LAXKIT_TAGGED_H
25 
26 #include <lax/lists.h>
27 
28 
29 namespace Laxkit {
30 
31 
32 //-------------------------------- Tagged ------------------------------------------
33 
34 class Tagged
35 {
36  protected:
37  PtrStack<char> list_of_tags;
38 
39  public:
40  int sorttags;
41  Tagged();
42  virtual ~Tagged();
43 
44  virtual int HasTag(const char *tag, int casematters);
45  virtual int NumberOfTags();
46  virtual const char *GetTag(int i);
47  virtual char *GetAllTags();
48  virtual int InsertTags(const char *tags, int casematters);
49  virtual int InsertTag(const char *tag, int casematters);
50  virtual int RemoveTag(const char *tag);
51  virtual int RemoveTag(int i);
52  virtual void FlushTags();
53 };
54 
55 
56 //-------------------------------- TagCloudInfo ------------------------------------------
57 
59 {
60  public:
61  int info;
62  char *tag;
63  PtrStack<Tagged> objs;
64 
65  TagCloudInfo(const char *t,int i=0);
66  virtual ~TagCloudInfo();
67 };
68 
69 
70 //-------------------------------- TagCloud ------------------------------------------
71 
72 class TagCloud : public Tagged
73 {
74  protected:
75  PtrStack<TagCloudInfo> taginfo;
76 
77  public:
78  int keep_empty_tags;
79 
80  TagCloud();
81  //virtual int InsertTags(const char *tags, int casematters);
82  //virtual int InsertTag(const char *tag, int casematters);
83  virtual int RemoveTag(const char *tag);
84  virtual int RemoveTag(int i);
85  virtual void FlushTags();
86 
87  virtual int AddObject(Tagged *obj);
88  virtual int RemoveObject(Tagged *obj);
89 };
90 
91 
92 
93 } //namespace Laxkit
94 
95 #endif

Mon Feb 17 2014 11:52:57, Laxkit