1 /* AbiWord
2  * Copyright (C) 2002 Tomas Frydrych <tomas@frydrych.uklinux.net>
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
17  * 02110-1301 USA.
18  */
19 
20 #ifndef AP_DIALOG_MARKREVISIONS_H
21 #define AP_DIALOG_MARKREVISIONS_H
22 
23 #include "xap_Dialog.h"
24 #include "pd_Document.h"
25 #include "xap_Strings.h"
26 
27 class XAP_Frame;
28 
29 class ABI_EXPORT AP_Dialog_MarkRevisions : public XAP_Dialog_NonPersistent
30 {
31 public:
32 	AP_Dialog_MarkRevisions(XAP_DialogFactory * pDlgFactory,
33 			     XAP_Dialog_Id id);
34 	virtual ~AP_Dialog_MarkRevisions(void);
35 
36 	virtual void  runModal(XAP_Frame * pFrame) = 0;
37 
38 	typedef enum { a_OK=0, a_CANCEL=1 } tAnswer;
39 
40 	tAnswer	      getAnswer(void) const;
41 	void          setAnswer(tAnswer a);
42 
setDocument(PD_Document * pDoc)43 	void          setDocument(PD_Document * pDoc) {m_pDoc = pDoc;}
forceNew()44 	void          forceNew() {m_bForceNew = true;}
45 
46 	const char *        getTitle();
47 	const char *        getRadio2Label();
48 	const char *        getComment2Label();
49 
50 
51 	/* the caller is responsible for freeing the pointers returned by
52 	   the following two functions (use FREEP)
53 	*/
54 	char *        getRadio1Label();
55 	char *        getComment1(bool utf8 = false);
56 
57 	void          setComment2(const char * pszComment);
58 	void          addRevision();
59 	bool		  isRev();
60 
61 protected:
62 	AP_Dialog_MarkRevisions::tAnswer	m_answer;
63 
64 private:
65 	void          _initRevision();
66 
67 	PD_Document *                       m_pDoc;
68 	UT_UTF8String *                     m_pComment2;
69 	const XAP_StringSet *               m_pSS;
70 	const AD_Revision *                 m_pRev;
71 	bool                                m_bForceNew;
72 };
73 
74 #endif /* AP_DIALOG_MARKREVISIONS_H */
75