Wittyshare  0.2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
WsModMenuImages.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2006-Today Guy Deleeuw
3 *
4 * See the LICENSE file for terms of use.
5 */
6 
7 #ifndef WsModMenuImages_H__
8 #define WsModMenuImages_H__ 1
9 
10 #include <Wt/WContainerWidget>
11 #include <Wt/WFileUpload>
12 #include <Wt/WProgressBar>
13 
14 #include <WsModule/src/WsModule.h>
15 
32 class WsMenuImages : public Wt::WContainerWidget, public WsOptions {
33 public :
35  WsMenuImages(Wt::WContainerWidget* parent = 0);
36  ~WsMenuImages();
37  void load();
38  void buildVector();
39  void buildMenu();
40 
42  void setMaxImages(int nMaxImages);
43 
44 public slots:
45  void doTimeout();
46 
47 private :
48  std::vector<std::string> m_vDirectories;
49  std::vector<std::string> m_vDisplayNames;
52  Wt::WTimer* m_pTimer;
53 };
54 
55 class WsModMenuImages : public WsModule {
56 public :
60  Wt::WWidget* createContentsMenuBar(Wt::WContainerWidget* parent = 0) const;
61  Wt::WWidget* createContents(Wt::WContainerWidget* parent = 0) const;
62  WsEditorWidget* createEditor(Wt::WContainerWidget* parent = 0) const;
63  Wt::WWidget* createAdmin(Wt::WContainerWidget* parent = 0) const;
64  bool saveEditor() const;
65  std::string description() const;
66 };
67 
68 extern "C" {
69  // http://phoxis.org/2011/04/27/c-language-constructors-and-destructors-with-gcc/
70  void WsModMenuImagesInit(void) __attribute__((constructor));
71 
73  {
74  return new WsModMenuImages();
75  }
76 }
77 
78 #endif // ifndef WsModMenuImages_H__
79 
void setMaxImages(int nMaxImages)
Set the number of images in the menu. If the number of images is more than this value a timer rotate ...
Wt::WWidget * createContentsMenuBar(Wt::WContainerWidget *parent=0) const
Create the functionalities.
bool saveEditor() const
Wt::WTimer * m_pTimer
void WsModMenuImagesInit(void) __attribute__((constructor))
base class for building a wittyShare module
std::vector< std::string > m_vDisplayNames
std::vector< std::string > m_vDirectories
std::string description() const
Return the description of the module.
WsModMenuImages * buildModule()
WsEditorWidget * createEditor(Wt::WContainerWidget *parent=0) const
Create the contents for an editor (create a view of options).
Wt::WWidget * createAdmin(Wt::WContainerWidget *parent=0) const
Create the contents for an administrator.
Wt::WWidget * createContents(Wt::WContainerWidget *parent=0) const
Create the contents.
WsMenuImages(Wt::WContainerWidget *parent=0)
CTor.