17 |
17 |
18 #ifndef XNTEXTEDITORPUBLISHER_H |
18 #ifndef XNTEXTEDITORPUBLISHER_H |
19 #define XNTEXTEDITORPUBLISHER_H |
19 #define XNTEXTEDITORPUBLISHER_H |
20 |
20 |
21 #include <e32base.h> |
21 #include <e32base.h> |
22 #include <eikedwob.h> |
22 #include <frmtview.h> |
23 |
23 |
24 // FORWARD DECLARATIONS |
24 // FORWARD DECLARATIONS |
25 class CLiwServiceHandler; |
25 class CLiwServiceHandler; |
26 class MLiwInterface; |
26 class MLiwInterface; |
27 class CXnTextEditorAdapter; |
27 class CXnTextEditorAdapter; |
28 |
28 |
29 class CXnTextEditorPublisher : public CBase, public MEikEdwinObserver |
29 class CXnTextEditorPublisher : public CBase, public CTextView::MObserver |
30 { |
30 { |
31 public: |
31 public: |
32 /** |
32 /** |
33 * Two-phased constructor. |
33 * Two-phased constructor. |
34 */ |
34 */ |
35 static CXnTextEditorPublisher* NewL( CXnTextEditorAdapter& aAdapter, |
35 static CXnTextEditorPublisher* NewL( CXnTextEditorAdapter& aAdapter, |
36 const TDesC8& aNodeId ); |
36 const TDesC8& aNodeId ); |
37 |
37 |
38 /** |
38 /** |
39 * Destructor. |
39 * Destructor. |
40 */ |
40 */ |
41 virtual ~CXnTextEditorPublisher(); |
41 virtual ~CXnTextEditorPublisher(); |
42 |
42 |
43 private: |
43 private: |
44 CXnTextEditorPublisher( CXnTextEditorAdapter& aAdapter ); |
44 // constructors |
45 void ConstructL( const TDesC8& aNodeId ); |
45 |
|
46 /** |
|
47 * C++ constructor |
|
48 */ |
|
49 CXnTextEditorPublisher( CXnTextEditorAdapter& aAdapter ); |
|
50 |
|
51 /** |
|
52 * 2nd phase constructor |
|
53 */ |
|
54 void ConstructL( const TDesC8& aNodeId ); |
46 |
55 |
47 public: // From MEikEdwinObserver |
56 public: |
48 /** |
57 // from CTextView::MObserver |
49 * @see MEikEdwinObserver. |
58 |
50 */ |
59 /** |
51 void HandleEdwinEventL(CEikEdwin* aEdwin,TEdwinEvent aEventType); |
60 * @see CTextView::MObserver |
52 |
61 */ |
53 void PublishTextL( const TDesC& aText ); |
62 void OnReformatL( const CTextView* aTextView ); |
|
63 |
|
64 public: |
|
65 // new functions |
|
66 |
|
67 /** |
|
68 * Publishes given text to CPS |
|
69 * |
|
70 * @since S60 5.2 |
|
71 * @param aText Text to publish |
|
72 */ |
|
73 void PublishTextL( const TDesC& aText ); |
54 |
74 |
55 private: // New functions |
75 private: |
56 void InitCpsInterfaceL(); |
76 // new functions |
57 void AddDataToCpsL( const TDesC& aPublisherId, const TDesC& aContentType, |
77 |
58 const TDesC& aContentId, const TDesC8& aDataKey, const TDesC& aData ); |
78 void InitCpsInterfaceL(); |
59 void RemoveDataFromCpsL( const TDesC& aPublisherId, const TDesC& aContentType, |
79 |
60 const TDesC& aContentId ); |
80 void AddDataToCpsL( const TDesC& aPublisherId, const TDesC& aContentType, |
|
81 const TDesC& aContentId, const TDesC8& aDataKey, const TDesC& aData ); |
|
82 |
|
83 void RemoveDataFromCpsL( const TDesC& aPublisherId, const TDesC& aContentType, |
|
84 const TDesC& aContentId ); |
61 |
85 |
62 |
86 private: |
63 private: |
87 // data |
64 CXnTextEditorAdapter& iAdapter; |
88 |
65 HBufC* iNodeId; // Own |
89 /** Text editor adapter, not owned */ |
66 MLiwInterface* iCpsInterface; // Not own |
90 CXnTextEditorAdapter& iAdapter; |
67 CLiwServiceHandler* iServiceHandler; // Own |
91 /** <texteditor> element node id, owned */ |
68 HBufC* iTextBuffer; // Own |
92 HBufC* iNodeId; |
|
93 /** CPS intertace, owned */ |
|
94 MLiwInterface* iCpsInterface; |
|
95 /** Service handler, owned */ |
|
96 CLiwServiceHandler* iServiceHandler; |
|
97 /** Text publish buffer, owned */ |
|
98 HBufC* iTextBuffer; |
|
99 /** Text publish temp buffer, owned */ |
|
100 HBufC* iTempBuffer; |
69 }; |
101 }; |
70 |
102 |
71 #endif //XNTEXTEDITORPUBLISHER_H |
103 #endif //XNTEXTEDITORPUBLISHER_H |
72 |
104 |
73 |
105 |