~ubuntu-branches/ubuntu/oneiric/codeblocks/oneiric

« back to all changes in this revision

Viewing changes to src/plugins/contrib/ThreadSearch/ThreadSearchViewManagerBase.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Casadevall
  • Date: 2008-07-17 04:39:23 UTC
  • Revision ID: james.westby@ubuntu.com-20080717043923-gmsy5cwkdjswghkm
Tags: upstream-8.02
ImportĀ upstreamĀ versionĀ 8.02

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************
 
2
 * Name:      ThreadSearchViewManagerBase
 
3
 * Purpose:   ThreadSearchViewManagerBase is an interface to the
 
4
 *            different graphical classes that can manage the view.
 
5
 * Author:    Jerome ANTOINE
 
6
 * Created:   2007-07-19
 
7
 * Copyright: Jerome ANTOINE
 
8
 * License:   GPL
 
9
 **************************************************************/
 
10
 
 
11
#ifndef THREAD_SEARCH_VIEW_MANAGER_BASE_H
 
12
#define THREAD_SEARCH_VIEW_MANAGER_BASE_H
 
13
 
 
14
class ThreadSearchView;
 
15
 
 
16
class ThreadSearchViewManagerBase
 
17
{
 
18
public:
 
19
        enum eManagerTypes
 
20
        {
 
21
                TypeMessagesNotebook = 0,
 
22
                TypeLayout
 
23
        };
 
24
 
 
25
        /** BuildThreadSearchViewManagerBase
 
26
          * Builds a ThreadSearchViewManagerMessagesNotebook or a ThreadSearchViewManagerAui pointer depending
 
27
          * on managerType.
 
28
          * @return ThreadSearchViewManagerBase*
 
29
          */
 
30
        static ThreadSearchViewManagerBase* BuildThreadSearchViewManagerBase(ThreadSearchView* pView,
 
31
                                                                                                                                                 bool              addViewToManager,
 
32
                                                                                                                                                 eManagerTypes     managerType);
 
33
 
 
34
        /** Destructor. */
 
35
        virtual ~ThreadSearchViewManagerBase() {}
 
36
 
 
37
        eManagerTypes virtual GetManagerType() = 0;
 
38
 
 
39
        /** By default, view is not managed by the manager.
 
40
          * This method adds view to manager if not already managed
 
41
          * and given in constructor.
 
42
          * No parameters because only m_pThreadSearchView is managed.
 
43
          */
 
44
        virtual void AddViewToManager() = 0;
 
45
 
 
46
        /** By default, view is not managed by the manager.
 
47
          * This method removes view from manager if managed.
 
48
          * No parameters because only m_pThreadSearchView is managed
 
49
          * and given in constructor.
 
50
          * m_pThreadSearchView is not modified.
 
51
          */
 
52
        virtual void RemoveViewFromManager() = 0;
 
53
 
 
54
        /** Return true if success. Fails if view is not managed.
 
55
          * @param show : true => show, false => hide
 
56
          * @return true if success.
 
57
          */
 
58
        virtual bool ShowView(bool show = true) = 0;
 
59
 
 
60
        /** Return true if view is visible.
 
61
          * @param show : true => show, false => hide
 
62
          * @return true if view is visible.
 
63
          */
 
64
        virtual bool IsViewShown() = 0;
 
65
 
 
66
protected:
 
67
        /** Constructor. */
 
68
        ThreadSearchViewManagerBase(ThreadSearchView* pThreadSearchView)
 
69
                : m_pThreadSearchView(pThreadSearchView)
 
70
                , m_IsManaged(false)
 
71
                , m_IsShown(false)
 
72
        {
 
73
        }
 
74
 
 
75
        ThreadSearchView* m_pThreadSearchView;
 
76
        bool              m_IsManaged;
 
77
        bool              m_IsShown;
 
78
};
 
79
 
 
80
#endif // THREAD_SEARCH_VIEW_MANAGER_BASE_H