File: ThreadSearchViewManagerBase.h

package info (click to toggle)
codeblocks 16.01%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 85,352 kB
  • sloc: cpp: 665,947; ansic: 48,306; sh: 32,198; xml: 29,690; makefile: 6,054; asm: 3,827; python: 3,251; f90: 1,202; pascal: 839; yacc: 291; perl: 261; sed: 16
file content (82 lines) | stat: -rw-r--r-- 2,687 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
/***************************************************************
 * Name:      ThreadSearchViewManagerBase
 * Purpose:   ThreadSearchViewManagerBase is an interface to the
 *            different graphical classes that can manage the view.
 * Author:    Jerome ANTOINE
 * Created:   2007-07-19
 * Copyright: Jerome ANTOINE
 * License:   GPL
 **************************************************************/

#ifndef THREAD_SEARCH_VIEW_MANAGER_BASE_H
#define THREAD_SEARCH_VIEW_MANAGER_BASE_H

class ThreadSearchView;

class ThreadSearchViewManagerBase
{
public:
    enum eManagerTypes
    {
        TypeMessagesNotebook = 0,
        TypeLayout
    };

    /** BuildThreadSearchViewManagerBase
      * Builds a ThreadSearchViewManagerMessagesNotebook or a ThreadSearchViewManagerAui pointer depending
      * on managerType.
      * @return ThreadSearchViewManagerBase*
      */
    static ThreadSearchViewManagerBase* BuildThreadSearchViewManagerBase(ThreadSearchView* pView,
                                                                         bool              addViewToManager,
                                                                         eManagerTypes     managerType);

    /** Destructor. */
    virtual ~ThreadSearchViewManagerBase() {}

    eManagerTypes virtual GetManagerType() = 0;

    /** By default, view is not managed by the manager.
      * This method adds view to manager if not already managed
      * and given in constructor.
      * No parameters because only m_pThreadSearchView is managed.
      */
    virtual void AddViewToManager() = 0;

    /** By default, view is not managed by the manager.
      * This method removes view from manager if managed.
      * No parameters because only m_pThreadSearchView is managed
      * and given in constructor.
      * m_pThreadSearchView is not modified.
      */
    virtual void RemoveViewFromManager() = 0;

    /** Return true if success. Fails if view is not managed.
      * @param show : true => show, false => hide
      * @return true if success.
      */
    virtual bool ShowView(bool show = true) = 0;

    /** Return true if view is visible.
      * @return true if view is visible.
      */
    virtual bool IsViewShown() = 0;

    /** Try to rise the panel the view is in */
    virtual void Raise() = 0;

protected:
    /** Constructor. */
    ThreadSearchViewManagerBase(ThreadSearchView* pThreadSearchView)
        : m_pThreadSearchView(pThreadSearchView)
        , m_IsManaged(false)
        , m_IsShown(false)
    {
    }

    ThreadSearchView* m_pThreadSearchView;
    bool              m_IsManaged;
    bool              m_IsShown;
};

#endif // THREAD_SEARCH_VIEW_MANAGER_BASE_H