10 Snippet( const QDomElement
& elem
, bool isCat
= false )
11 : mod( false ), op( false ), ed( 0 ), cat( isCat
) {
12 tit
= elem
.firstChildElement( "title" ).text();
13 cd
= elem
.firstChildElement( "code" ).text();
14 desc
= elem
.firstChildElement( "description" ).text();
16 Snippet( const QString
& t
, bool isCat
= false )
17 : mod( false ), op( false ), ed( 0 ), tit( t
), cd( "" ), desc( "" ), cat( isCat
) {}
18 Snippet( const Snippet
& snippet
)
19 : mod( snippet
.mod
), op( snippet
.mod
), ed( snippet
.ed
), tit( snippet
.tit
), cd( snippet
.cd
),
20 desc( snippet
.desc
), tab( snippet
.tab
), cat( snippet
.cat
) {}
22 QString
code() const { return cd
; }
23 QString
description() const { return desc
; }
24 TextEdit
* edit() const { return ed
; }
25 bool isCategory() { return cat
; }
26 bool isModified() { return mod
; }
27 bool isOpened() { return op
; }
28 void save( const QString
& adesc
= "" ) {
29 cd
= ed
->toPlainText();
32 void setDescription( const QString
& adesc
) { desc
= adesc
; }
33 void setEdit( TextEdit
* edit
) { ed
= edit
; }
34 void setOpened( bool val
= true ) { op
= val
; }
35 void setModified( bool val
= true ) { mod
= val
; }
36 void setTab( const int& t
) { tab
= t
; }
37 void setTempDescription( const QString
& atemp
) { tempDesc
= atemp
; }
38 void setTitle( const QString
& atitle
) { tit
= atitle
; }
39 void setToolTip( const QString
& atooltip
) { tooltip
= atooltip
; }
40 int tabNumber() { return tab
; }
41 QString
tempDescription() const { return tempDesc
; }
42 QString
title() const { return tit
; }
43 QString
toolTip() const { return tooltip
; }