PieDock  1.6.3
Menu.h
1 /*
2  * O ,-
3  * ° o . -´ ' ,-
4  * ° .´ ` . ´,´
5  * ( ° )) . (
6  * `-;_ . -´ `.`.
7  * `._' ´
8  *
9  * Copyright (c) 2007-2010 Markus Fisch <mf@markusfisch.de>
10  *
11  * Licensed under the MIT license:
12  * http://www.opensource.org/licenses/mit-license.php
13  */
14 #ifndef _PieDock_Menu_
15 #define _PieDock_Menu_
16 
17 #include "Application.h"
18 #include "Settings.h"
19 #include "Icon.h"
20 #include "MenuItems.h"
21 
22 #include <string>
23 
24 namespace PieDock
25 {
31  class Menu
32  {
33  public:
34  Menu( Application * );
35  virtual ~Menu() {}
36  inline void setWindowBelowCursor( Window w ) {
37  windowBelowCursor = w; }
38  inline const Window &getWindowBelowCursor() const {
39  return windowBelowCursor; }
40  inline MenuItem *getSelected() const {
41  return selected; }
42  inline const std::string &getName() const {
43  return name; }
44  virtual bool update( std::string, Window = 0 );
45  virtual void draw( int, int ) {}
46  virtual bool change( Settings::Action = Settings::Launch );
47  virtual void execute( Settings::Action = Settings::Launch );
48  virtual std::string getItemTitle() const;
49 
50  protected:
51  inline Application *getApp() const { return app; }
52  inline void setSelected( MenuItem *s ) {
53  selected = s; }
54  inline MenuItems *getMenuItems() const {
55  return menuItems; }
56  virtual int run( std::string ) const;
57 
58  private:
59  Application *app;
60  MenuItem *selected;
61  MenuItems *menuItems;
62  MenuItems openWindows;
63  Window windowBelowCursor;
64  std::string name;
65  };
66 }
67 
68 #endif