summaryrefslogtreecommitdiffstats
path: root/umbrello/umbrello/notewidgetcontroller.h
blob: 081556eddf6009ca5cb401d263ed2490b05c59f4 (plain)
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
/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   copyright (C) 2006                                                    *
 *   Umbrello UML Modeller Authors <uml-devel@uml.sf.net>                  *
 ***************************************************************************/

#ifndef NOTEWIDGETCONTROLLER_H
#define NOTEWIDGETCONTROLLER_H

#include "umlwidgetcontroller.h"

class NoteWidget;

/**
 * Controller for NoteWidget.
 *
 * MouseMove and MouseRelease execute the base code and then specific code
 * for note widget.
 *
 * Double click behaviour is edit the text of the note.
 *
 * @author Umbrello UML Modeller Authors <uml-devel@lists.sourceforge.net>
 */
class NoteWidgetController : public UMLWidgetController {
public:

    /**
     * Constructor for NoteWidgetController.
     *
     * @param noteWidget The NoteWidget which uses the controller.
     */
    NoteWidgetController(NoteWidget* noteWidget);

    /**
     * Destructor for NoteWidgetController.
     */
    virtual ~NoteWidgetController();

    /**
     * Overriden from UMLWidgetController.
     * Handles a mouse move event.
     * Executes base code and then sets the geometry of the editor.
     *
     * @param me The TQMouseEvent event.
     */
    virtual void mouseMoveEvent(TQMouseEvent* me);

    /**
     * Overriden from UMLWidgetController.
     * Handles a mouse release event.
     * Executes base code and then draws the text in the note.
     *
     * @param me The TQMouseEvent event.
     */
    virtual void mouseReleaseEvent(TQMouseEvent * me);

protected:

    /**
     * Overriden from UMLWidgetController.
     * Executes the action for double click in the widget.
     * Shows the dialog to change the text of the note.
     *
     * @param me The TQMouseEvent which triggered the double click event.
     */
    virtual void doMouseDoubleClick(TQMouseEvent *me);

private:

    /**
     * The note widget which uses the controller.
     */
    NoteWidget* m_noteWidget;
};

#endif