~ubuntu-branches/ubuntu/precise/konsole/precise-proposed

« back to all changes in this revision

Viewing changes to src/ViewProperties.h

  • Committer: Package Import Robot
  • Author(s): Jonathan Riddell
  • Date: 2011-12-16 13:14:43 UTC
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: package-import@ubuntu.com-20111216131443-rhdplbmmuxntat3k
Tags: upstream-4.7.90
ImportĀ upstreamĀ versionĀ 4.7.90

Show diffs side-by-side

added added

removed removed

Lines of Context:
35
35
namespace Konsole
36
36
{
37
37
 
38
 
/** 
 
38
/**
39
39
 * Encapsulates user-visible information about the terminal session currently being displayed in a view,
40
40
 * such as the associated title and icon.
41
41
 *
42
42
 * This can be used by navigation widgets in a ViewContainer sub-class to provide a tab, label or other
43
43
 * item for switching between views.
44
44
 */
45
 
class KONSOLEPRIVATE_EXPORT ViewProperties : public QObject 
 
45
class KONSOLEPRIVATE_EXPORT ViewProperties : public QObject
46
46
{
47
47
Q_OBJECT
48
48
 
49
49
public:
50
 
    ViewProperties(QObject* parent); 
 
50
    ViewProperties(QObject* parent);
51
51
    virtual ~ViewProperties();
52
52
 
53
53
    /** Returns the icon associated with a view */
55
55
    /** Returns the title associated with a view */
56
56
    QString title() const;
57
57
 
58
 
    /** 
 
58
    /**
59
59
     * Returns the URL current associated with a view.
60
 
     * The default implementation returns an empty URL. 
 
60
     * The default implementation returns an empty URL.
61
61
     */
62
62
    virtual KUrl url() const;
63
63
 
68
68
     */
69
69
    virtual QString currentDir() const;
70
70
 
71
 
    /** 
 
71
    /**
72
72
     * A unique identifier associated with this
73
73
     * ViewProperties instance.
74
74
     */
75
75
    int identifier() const;
76
76
 
77
77
    /**
78
 
     * Sub-classes may re-implement this method to display a message to the user 
 
78
     * Sub-classes may re-implement this method to display a message to the user
79
79
     * to allow them to confirm whether to close a view.
80
80
     * The default implementation always returns true
81
81
     */
82
 
    virtual bool confirmClose() const
83
 
    { return true; }
 
82
    virtual bool confirmClose() const { return true; }
84
83
 
85
84
    /** Finds a ViewProperties instance given its numeric identifier. */
86
85
    static ViewProperties* propertiesById(int id);
87
86
 
88
87
    /** Name of mime format to use in drag-and-drop operations. */
89
 
    static QString mimeType() 
90
 
    { return _mimeType; }
91
 
   
92
 
    /** Returns a new QMimeData instance which represents the view with the given @p id 
 
88
    static QString mimeType() { return _mimeType; }
 
89
 
 
90
    /** Returns a new QMimeData instance which represents the view with the given @p id
93
91
     * (See identifier()).  The QMimeData instance returned must be deleted by the caller.
94
92
     */
95
93
    static QMimeData* createMimeData(int id)
99
97
        mimeData->setData(mimeType(),data);
100
98
        return mimeData;
101
99
    }
102
 
    /** Decodes a QMimeData instance created with createMimeData() and returns the identifier 
 
100
    /** Decodes a QMimeData instance created with createMimeData() and returns the identifier
103
101
     * of the associated view.  The associated ViewProperties instance can then be retrieved by
104
 
     * calling propertiesById() 
 
102
     * calling propertiesById()
105
103
     *
106
104
     * The QMimeData instance must support the mime format returned by mimeType()
107
105
     */
130
128
    void fireActivity();
131
129
 
132
130
protected:
133
 
    /** 
 
131
    /**
134
132
     * Subclasses may call this method to change the title.  This causes
135
 
     * a titleChanged() signal to be emitted 
 
133
     * a titleChanged() signal to be emitted
136
134
     */
137
135
    void setTitle(const QString& title);
138
136
    /**