| OLD | NEW |
| 1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
| 6 | 6 |
| 7 #ifndef _PWL_NOTE_H_ | 7 #ifndef _PWL_NOTE_H_ |
| 8 #define _PWL_NOTE_H_ | 8 #define _PWL_NOTE_H_ |
| 9 | 9 |
| 10 class IPWL_NoteNotify; | 10 class IPWL_NoteNotify; |
| 11 class IPWL_NoteHandler; | 11 class IPWL_NoteHandler; |
| 12 class IPWL_NoteItem; | 12 class IPWL_NoteItem; |
| 13 class CPWL_NoteItem; | 13 class CPWL_NoteItem; |
| 14 class CPWL_Note; | 14 class CPWL_Note; |
| 15 class CPWL_Label; | 15 class CPWL_Label; |
| 16 class CPWL_Edit; | 16 class CPWL_Edit; |
| 17 class CPWL_Note_Icon; | 17 class CPWL_Note_Icon; |
| 18 class CPWL_Note_CloseBox; | 18 class CPWL_Note_CloseBox; |
| 19 class CPWL_Note_LBBox; | 19 class CPWL_Note_LBBox; |
| 20 class CPWL_Note_RBBox; | 20 class CPWL_Note_RBBox; |
| 21 class CPWL_Note_Edit; | 21 class CPWL_Note_Edit; |
| 22 class CPWL_Note_Options; | 22 class CPWL_Note_Options; |
| 23 class CPWL_Note_Contents; | 23 class CPWL_Note_Contents; |
| 24 class IPopup_Note; | 24 class IPopup_Note; |
| 25 | 25 |
| 26 | 26 class IPWL_NoteNotify { |
| 27 class IPWL_NoteNotify | 27 public: |
| 28 { | 28 virtual void OnNoteMove(const FX_RECT& rtWin) = 0; |
| 29 public: | 29 virtual void OnNoteShow(FX_BOOL bShow) = 0; |
| 30 virtual void OnNoteMove(const
FX_RECT& rtWin) = 0; | 30 virtual void OnNoteActivate(FX_BOOL bActive) = 0; |
| 31 virtual void OnNoteShow(FX_BO
OL bShow) = 0; | 31 virtual void OnNoteClose() = 0; |
| 32 virtual void OnNoteActivate(F
X_BOOL bActive) = 0; | 32 virtual void OnItemCreate(IPWL_NoteItem* pItem) = 0; |
| 33 virtual void OnNoteClose() =
0; | 33 virtual void OnItemDelete(IPWL_NoteItem* pItem) = 0; |
| 34 virtual void OnItemCreate(IPW
L_NoteItem* pItem) = 0; | 34 virtual void OnSetAuthorName(IPWL_NoteItem* pItem) = 0; |
| 35 virtual void OnItemDelete(IPW
L_NoteItem* pItem) = 0; | 35 virtual void OnSetBkColor(IPWL_NoteItem* pItem) = 0; |
| 36 virtual void OnSetAuthorName(
IPWL_NoteItem* pItem) = 0; | 36 virtual void OnSetContents(IPWL_NoteItem* pItem) = 0; |
| 37 virtual void OnSetBkColor(IPW
L_NoteItem* pItem) = 0; | 37 virtual void OnSetDateTime(IPWL_NoteItem* pItem) = 0; |
| 38 virtual void OnSetContents(IP
WL_NoteItem* pItem) = 0; | 38 virtual void OnSetSubjectName(IPWL_NoteItem* pItem) = 0; |
| 39 virtual void OnSetDateTime(IP
WL_NoteItem* pItem) = 0; | 39 virtual void OnPopupMenu(FX_INT32 x, FX_INT32 y) = 0; |
| 40 virtual void OnSetSubjectName
(IPWL_NoteItem* pItem) = 0; | 40 virtual void OnPopupMenu(IPWL_NoteItem* pItem, FX_INT32 x, FX_INT32 y) = 0; |
| 41 virtual void OnPopupMenu(FX_I
NT32 x, FX_INT32 y) = 0; | 41 }; |
| 42 virtual void OnPopupMenu(IPWL
_NoteItem* pItem, FX_INT32 x, FX_INT32 y) = 0; | 42 |
| 43 }; | 43 class IPWL_NoteHandler { |
| 44 | 44 public: |
| 45 class IPWL_NoteHandler | 45 virtual void OnNoteColorChanged(const CPWL_Color& color) = 0; |
| 46 { | 46 }; |
| 47 public: | 47 |
| 48 virtual void OnNoteColorChang
ed(const CPWL_Color& color) = 0; | 48 class IPWL_NoteItem { |
| 49 }; | 49 public: |
| 50 | 50 virtual void SetPrivateData(void* pData) = 0; |
| 51 class IPWL_NoteItem | 51 virtual void SetBkColor(const CPWL_Color& color) = 0; |
| 52 { | 52 virtual void SetSubjectName(const CFX_WideString& sName) = 0; |
| 53 public: | 53 virtual void SetAuthorName(const CFX_WideString& sName) = 0; |
| 54 virtual void SetPrivateData(v
oid* pData) = 0; | 54 virtual void SetDateTime(FX_SYSTEMTIME time) = 0; |
| 55 virtual void SetBkColor(const
CPWL_Color& color) = 0; | 55 virtual void SetContents(const CFX_WideString& sContents) = 0; |
| 56 virtual void SetSubjectName(c
onst CFX_WideString& sName) = 0; | 56 |
| 57 virtual void SetAuthorName(co
nst CFX_WideString& sName) = 0; | 57 virtual IPWL_NoteItem* CreateSubItem() = 0; |
| 58 virtual void SetDateTime(FX_S
YSTEMTIME time) = 0; | 58 virtual FX_INT32 CountSubItems() const = 0; |
| 59 virtual void SetContents(cons
t CFX_WideString& sContents) = 0; | 59 virtual IPWL_NoteItem* GetSubItems(FX_INT32 index) const = 0; |
| 60 | 60 virtual void DeleteSubItem(IPWL_NoteItem* pNoteItem) = 0; |
| 61 virtual IPWL_NoteItem* CreateSubItem() = 0; | 61 virtual void SetFocus() = 0; |
| 62 virtual FX_INT32 CountSubItems()
const = 0; | 62 |
| 63 virtual IPWL_NoteItem* GetSubItems(FX_INT32 ind
ex) const = 0; | 63 virtual IPWL_NoteItem* GetParentItem() const = 0; |
| 64 virtual void DeleteSubItem(IP
WL_NoteItem* pNoteItem) = 0; | 64 virtual void* GetPrivateData() const = 0; |
| 65 virtual void SetFocus() = 0; | 65 virtual CFX_WideString GetAuthorName() const = 0; |
| 66 | 66 virtual CPWL_Color GetBkColor() const = 0; |
| 67 virtual IPWL_NoteItem* GetParentItem() const =
0; | 67 virtual CFX_WideString GetContents() const = 0; |
| 68 virtual void* GetPrivateData()
const = 0; | 68 virtual FX_SYSTEMTIME GetDateTime() const = 0; |
| 69 virtual CFX_WideString GetAuthorName() const =
0; | 69 virtual CFX_WideString GetSubjectName() const = 0; |
| 70 virtual CPWL_Color GetBkColor() con
st = 0; | 70 |
| 71 virtual CFX_WideString GetContents() const = 0; | 71 virtual CPWL_Edit* GetEdit() const = 0; |
| 72 virtual FX_SYSTEMTIME GetDateTime() const = 0; | 72 }; |
| 73 virtual CFX_WideString GetSubjectName() const =
0; | 73 |
| 74 | 74 class PWL_CLASS CPWL_Note_Icon : public CPWL_Wnd { |
| 75 virtual CPWL_Edit* GetEdit() const
= 0; | 75 public: |
| 76 }; | 76 CPWL_Note_Icon(); |
| 77 | 77 virtual ~CPWL_Note_Icon(); |
| 78 class PWL_CLASS CPWL_Note_Icon : public CPWL_Wnd | 78 |
| 79 { | 79 void SetIconType(FX_INT32 nType); |
| 80 public: | 80 |
| 81 CPWL_Note_Icon(); | 81 public: |
| 82 virtual ~CPWL_Note_Icon(); | 82 protected: |
| 83 | 83 virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, |
| 84 void SetIconT
ype(FX_INT32 nType); | 84 CPDF_Matrix* pUser2Device); |
| 85 | 85 |
| 86 public: | 86 private: |
| 87 | 87 FX_INT32 m_nType; |
| 88 protected: | 88 }; |
| 89 virtual void DrawThisAppearan
ce(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device); | 89 |
| 90 | 90 class CPWL_Note_CloseBox : public CPWL_Button { |
| 91 private: | 91 public: |
| 92 FX_INT32 m_nType; | 92 CPWL_Note_CloseBox(); |
| 93 }; | 93 virtual ~CPWL_Note_CloseBox(); |
| 94 | 94 |
| 95 class CPWL_Note_CloseBox : public CPWL_Button | 95 protected: |
| 96 { | 96 virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, |
| 97 public: | 97 CPDF_Matrix* pUser2Device); |
| 98 CPWL_Note_CloseBox(); | 98 virtual FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag); |
| 99 virtual ~CPWL_Note_CloseBox(); | 99 virtual FX_BOOL OnLButtonUp(const CPDF_Point& point, FX_DWORD nFlag); |
| 100 | 100 |
| 101 protected: | 101 private: |
| 102 virtual void DrawThisAppearan
ce(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device); | 102 FX_BOOL m_bMouseDown; |
| 103 virtual FX_BOOL OnLButtonDown(co
nst CPDF_Point & point, FX_DWORD nFlag); | 103 }; |
| 104 virtual FX_BOOL OnLButtonUp(cons
t CPDF_Point & point, FX_DWORD nFlag); | 104 |
| 105 | 105 class CPWL_Note_LBBox : public CPWL_Wnd { |
| 106 private: | 106 public: |
| 107 FX_BOOL m_bMouse
Down; | 107 CPWL_Note_LBBox(); |
| 108 }; | 108 virtual ~CPWL_Note_LBBox(); |
| 109 | 109 |
| 110 class CPWL_Note_LBBox : public CPWL_Wnd | 110 protected: |
| 111 { | 111 virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, |
| 112 public: | 112 CPDF_Matrix* pUser2Device); |
| 113 CPWL_Note_LBBox(); | 113 }; |
| 114 virtual ~CPWL_Note_LBBox(); | 114 |
| 115 | 115 class CPWL_Note_RBBox : public CPWL_Wnd { |
| 116 protected: | 116 public: |
| 117 virtual void DrawThisAppearan
ce(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device); | 117 CPWL_Note_RBBox(); |
| 118 }; | 118 virtual ~CPWL_Note_RBBox(); |
| 119 | 119 |
| 120 class CPWL_Note_RBBox : public CPWL_Wnd | 120 protected: |
| 121 { | 121 virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, |
| 122 public: | 122 CPDF_Matrix* pUser2Device); |
| 123 CPWL_Note_RBBox(); | 123 }; |
| 124 virtual ~CPWL_Note_RBBox(); | 124 |
| 125 | 125 class CPWL_Note_Edit : public CPWL_Edit { |
| 126 protected: | 126 public: |
| 127 virtual void DrawThisAppearan
ce(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device); | 127 CPWL_Note_Edit(); |
| 128 }; | 128 virtual ~CPWL_Note_Edit(); |
| 129 | 129 |
| 130 class CPWL_Note_Edit : public CPWL_Edit | 130 void EnableNotify(FX_BOOL bEnable) { m_bEnableNotify = bEnable; } |
| 131 { | 131 virtual FX_FLOAT GetItemHeight(FX_FLOAT fLimitWidth); |
| 132 public: | 132 FX_FLOAT GetItemLeftMargin(); |
| 133 CPWL_Note_Edit(); | 133 FX_FLOAT GetItemRightMargin(); |
| 134 virtual ~CPWL_Note_Edit(); | 134 |
| 135 | 135 virtual void SetText(FX_LPCWSTR csText); |
| 136 void EnableNo
tify(FX_BOOL bEnable) {m_bEnableNotify = bEnable;} | 136 |
| 137 virtual FX_FLOAT GetItemHeight(FX
_FLOAT fLimitWidth); | 137 protected: |
| 138 FX_FLOAT GetItemL
eftMargin(); | 138 virtual void OnNotify(CPWL_Wnd* pWnd, |
| 139 FX_FLOAT GetItemR
ightMargin(); | 139 FX_DWORD msg, |
| 140 | 140 FX_INTPTR wParam = 0, |
| 141 virtual void SetText(FX_LPCWS
TR csText); | 141 FX_INTPTR lParam = 0); |
| 142 | 142 virtual void RePosChildWnd(); |
| 143 protected: | 143 virtual void OnSetFocus(); |
| 144 virtual void OnNotify(CPWL_Wn
d* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0); | 144 virtual void OnKillFocus(); |
| 145 virtual void RePosChildWnd(); | 145 |
| 146 virtual void OnSetFocus(); | 146 private: |
| 147 virtual void OnKillFocus(); | 147 FX_BOOL m_bEnableNotify; |
| 148 | 148 FX_FLOAT m_fOldItemHeight; |
| 149 private: | 149 FX_BOOL m_bSizeChanged; |
| 150 FX_BOOL m_bEnabl
eNotify; | 150 FX_FLOAT m_fOldMin; |
| 151 FX_FLOAT m_fOldIt
emHeight; | 151 FX_FLOAT m_fOldMax; |
| 152 FX_BOOL m_bSizeC
hanged; | 152 }; |
| 153 FX_FLOAT m_fOldMi
n; | 153 |
| 154 FX_FLOAT m_fOldMa
x; | 154 class CPWL_Note_Options : public CPWL_Wnd { |
| 155 }; | 155 public: |
| 156 | 156 CPWL_Note_Options(); |
| 157 class CPWL_Note_Options : public CPWL_Wnd | 157 virtual ~CPWL_Note_Options(); |
| 158 { | 158 |
| 159 public: | 159 CPDF_Rect GetContentRect() const; |
| 160 CPWL_Note_Options(); | 160 virtual void SetTextColor(const CPWL_Color& color); |
| 161 virtual ~CPWL_Note_Options(); | 161 void SetText(const CFX_WideString& sText); |
| 162 | 162 |
| 163 CPDF_Rect GetConte
ntRect() const; | 163 protected: |
| 164 virtual void SetTextColor(con
st CPWL_Color & color); | 164 virtual void RePosChildWnd(); |
| 165 void SetText(
const CFX_WideString& sText); | 165 virtual void CreateChildWnd(const PWL_CREATEPARAM& cp); |
| 166 | 166 virtual void DrawThisAppearance(CFX_RenderDevice* pDevice, |
| 167 protected: | 167 CPDF_Matrix* pUser2Device); |
| 168 virtual void RePosChildWnd(); | 168 |
| 169 virtual void CreateChildWnd(c
onst PWL_CREATEPARAM & cp); | 169 private: |
| 170 virtual void DrawThisAppearan
ce(CFX_RenderDevice* pDevice, CPDF_Matrix* pUser2Device); | 170 CPWL_Label* m_pText; |
| 171 | 171 }; |
| 172 private: | 172 |
| 173 CPWL_Label* m_pText; | 173 class CPWL_Note_Contents : public CPWL_ListCtrl { |
| 174 }; | 174 public: |
| 175 | 175 CPWL_Note_Contents(); |
| 176 class CPWL_Note_Contents : public CPWL_ListCtrl | 176 virtual ~CPWL_Note_Contents(); |
| 177 { | 177 |
| 178 public: | 178 virtual CFX_ByteString GetClassName() const; |
| 179 CPWL_Note_Contents(); | 179 virtual void OnNotify(CPWL_Wnd* pWnd, |
| 180 virtual ~CPWL_Note_Contents(); | 180 FX_DWORD msg, |
| 181 | 181 FX_INTPTR wParam = 0, |
| 182 virtual CFX_ByteString GetClassName() const; | 182 FX_INTPTR lParam = 0); |
| 183 virtual void OnNotify(CPWL_Wn
d* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0); | 183 virtual FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag); |
| 184 virtual FX_BOOL OnLButtonDown(co
nst CPDF_Point& point, FX_DWORD nFlag); | 184 |
| 185 | 185 void SetEditFocus(FX_BOOL bLast); |
| 186 void SetEditF
ocus(FX_BOOL bLast); | 186 CPWL_Edit* GetEdit() const; |
| 187 CPWL_Edit* GetEdit(
) const; | 187 |
| 188 | 188 public: |
| 189 public: | 189 void SetText(const CFX_WideString& sText); |
| 190 void SetText(
const CFX_WideString& sText); | 190 CFX_WideString GetText() const; |
| 191 CFX_WideString GetText() const; | 191 |
| 192 | 192 CPWL_NoteItem* CreateSubItem(); |
| 193 CPWL_NoteItem* CreateSubItem(); | 193 void DeleteSubItem(IPWL_NoteItem* pNoteItem); |
| 194 void DeleteSu
bItem(IPWL_NoteItem* pNoteItem); | 194 FX_INT32 CountSubItems() const; |
| 195 FX_INT32 CountSub
Items() const; | 195 IPWL_NoteItem* GetSubItems(FX_INT32 index) const; |
| 196 IPWL_NoteItem* GetSubItems(FX_I
NT32 index) const; | 196 |
| 197 | 197 virtual IPWL_NoteItem* GetHitNoteItem(const CPDF_Point& point); |
| 198 virtual IPWL_NoteItem* GetHitNoteItem(const CPD
F_Point& point); | 198 void EnableRead(FX_BOOL bEnabled); |
| 199 void EnableRe
ad(FX_BOOL bEnabled); | 199 void EnableModify(FX_BOOL bEnabled); |
| 200 void EnableMo
dify(FX_BOOL bEnabled); | 200 |
| 201 | 201 protected: |
| 202 protected: | 202 virtual void CreateChildWnd(const PWL_CREATEPARAM& cp); |
| 203 virtual void CreateChildWnd(c
onst PWL_CREATEPARAM & cp); | 203 |
| 204 | 204 private: |
| 205 private: | 205 CPWL_Note_Edit* m_pEdit; |
| 206 CPWL_Note_Edit* m_pEdit; | 206 }; |
| 207 }; | 207 |
| 208 | 208 class PWL_CLASS CPWL_NoteItem : public CPWL_Wnd, public IPWL_NoteItem { |
| 209 class PWL_CLASS CPWL_NoteItem : public CPWL_Wnd, public IPWL_NoteItem | 209 public: |
| 210 { | 210 CPWL_NoteItem(); |
| 211 public: | 211 virtual ~CPWL_NoteItem(); |
| 212 CPWL_NoteItem(); | 212 |
| 213 virtual ~CPWL_NoteItem(); | 213 public: |
| 214 | 214 virtual void SetPrivateData(void* pData); |
| 215 public: | 215 virtual void SetBkColor(const CPWL_Color& color); |
| 216 virtual void SetPrivateData(v
oid* pData); | 216 virtual void SetSubjectName(const CFX_WideString& sName); |
| 217 virtual void SetBkColor(const
CPWL_Color& color); | 217 virtual void SetAuthorName(const CFX_WideString& sName); |
| 218 virtual void SetSubjectName(c
onst CFX_WideString& sName); | 218 virtual void SetDateTime(FX_SYSTEMTIME time); |
| 219 virtual void SetAuthorName(co
nst CFX_WideString& sName); | 219 virtual void SetContents(const CFX_WideString& sContents); |
| 220 virtual void SetDateTime(FX_S
YSTEMTIME time); | 220 |
| 221 virtual void SetContents(cons
t CFX_WideString& sContents); | 221 virtual IPWL_NoteItem* CreateSubItem(); |
| 222 | 222 virtual FX_INT32 CountSubItems() const; |
| 223 virtual IPWL_NoteItem* CreateSubItem(); | 223 virtual IPWL_NoteItem* GetSubItems(FX_INT32 index) const; |
| 224 virtual FX_INT32 CountSubItems()
const; | 224 virtual void DeleteSubItem(IPWL_NoteItem* pNoteItem); |
| 225 virtual IPWL_NoteItem* GetSubItems(FX_INT32 ind
ex) const; | 225 virtual void SetFocus() { SetNoteFocus(FALSE); } |
| 226 virtual void DeleteSubItem(IP
WL_NoteItem* pNoteItem); | 226 |
| 227 virtual void SetFocus(){SetNo
teFocus(FALSE);} | 227 virtual IPWL_NoteItem* GetParentItem() const; |
| 228 | 228 virtual void* GetPrivateData() const; |
| 229 virtual IPWL_NoteItem* GetParentItem() const; | 229 virtual CFX_WideString GetAuthorName() const; |
| 230 virtual void* GetPrivateData()
const; | 230 virtual CPWL_Color GetBkColor() const; |
| 231 virtual CFX_WideString GetAuthorName() const; | 231 virtual CFX_WideString GetContents() const; |
| 232 virtual CPWL_Color GetBkColor() con
st; | 232 virtual FX_SYSTEMTIME GetDateTime() const; |
| 233 virtual CFX_WideString GetContents() const; | 233 virtual CFX_WideString GetSubjectName() const; |
| 234 virtual FX_SYSTEMTIME GetDateTime() const; | 234 virtual FX_BOOL IsTopItem() const { return FALSE; } |
| 235 virtual CFX_WideString GetSubjectName() const; | 235 virtual CPWL_Edit* GetEdit() const; |
| 236 virtual FX_BOOL IsTopItem() cons
t { return FALSE;} | 236 |
| 237 virtual CPWL_Edit* GetEdit() const; | 237 public: |
| 238 | 238 virtual FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag); |
| 239 public: | 239 virtual FX_BOOL OnRButtonUp(const CPDF_Point& point, FX_DWORD nFlag); |
| 240 virtual FX_BOOL OnLButtonDown(co
nst CPDF_Point& point, FX_DWORD nFlag); | 240 virtual CFX_ByteString GetClassName() const; |
| 241 virtual FX_BOOL OnRButtonUp(cons
t CPDF_Point & point, FX_DWORD nFlag); | 241 virtual IPWL_NoteItem* GetHitNoteItem(const CPDF_Point& point); |
| 242 virtual CFX_ByteString GetClassName() const; | 242 virtual IPWL_NoteItem* GetFocusedNoteItem() const; |
| 243 virtual IPWL_NoteItem* GetHitNoteItem(const CPD
F_Point& point); | 243 |
| 244 virtual IPWL_NoteItem* GetFocusedNoteItem() con
st; | 244 virtual void ResetSubjectName(FX_INT32 nItemIndex); |
| 245 | 245 void EnableRead(FX_BOOL bEnabled); |
| 246 virtual void ResetSubjectName
(FX_INT32 nItemIndex); | 246 void EnableModify(FX_BOOL bEnabled); |
| 247 void EnableRe
ad(FX_BOOL bEnabled); | 247 |
| 248 void EnableMo
dify(FX_BOOL bEnabled); | 248 protected: |
| 249 | 249 virtual void RePosChildWnd(); |
| 250 protected: | 250 virtual void CreateChildWnd(const PWL_CREATEPARAM& cp); |
| 251 virtual void RePosChildWnd(); | 251 |
| 252 virtual void CreateChildWnd(c
onst PWL_CREATEPARAM & cp); | 252 virtual void OnNotify(CPWL_Wnd* pWnd, |
| 253 | 253 FX_DWORD msg, |
| 254 virtual void OnNotify(CPWL_Wn
d* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0); | 254 FX_INTPTR wParam = 0, |
| 255 | 255 FX_INTPTR lParam = 0); |
| 256 public: | 256 |
| 257 virtual FX_FLOAT GetItemHeight(FX
_FLOAT fLimitWidth); | 257 public: |
| 258 virtual FX_FLOAT GetItemLeftMargi
n(); | 258 virtual FX_FLOAT GetItemHeight(FX_FLOAT fLimitWidth); |
| 259 virtual FX_FLOAT GetItemRightMarg
in(); | 259 virtual FX_FLOAT GetItemLeftMargin(); |
| 260 CPWL_NoteItem* CreateNoteItem()
; | 260 virtual FX_FLOAT GetItemRightMargin(); |
| 261 CPWL_NoteItem* GetParentNoteIte
m() const; | 261 CPWL_NoteItem* CreateNoteItem(); |
| 262 | 262 CPWL_NoteItem* GetParentNoteItem() const; |
| 263 void SetNoteF
ocus(FX_BOOL bLast); | 263 |
| 264 void OnConten
tsValidate(); | 264 void SetNoteFocus(FX_BOOL bLast); |
| 265 | 265 void OnContentsValidate(); |
| 266 void OnCreate
NoteItem(); | 266 |
| 267 | 267 void OnCreateNoteItem(); |
| 268 protected: | 268 |
| 269 void PopupNot
eItemMenu(const CPDF_Point& point); | 269 protected: |
| 270 | 270 void PopupNoteItemMenu(const CPDF_Point& point); |
| 271 virtual const CPWL_Note* GetNote() const; | 271 |
| 272 virtual IPWL_NoteNotify* GetNoteNotify() const; | 272 virtual const CPWL_Note* GetNote() const; |
| 273 | 273 virtual IPWL_NoteNotify* GetNoteNotify() const; |
| 274 protected: | 274 |
| 275 CPWL_Label* m_pSubje
ct; | 275 protected: |
| 276 CPWL_Label* m_pDateT
ime; | 276 CPWL_Label* m_pSubject; |
| 277 CPWL_Note_Contents* m_pContents; | 277 CPWL_Label* m_pDateTime; |
| 278 | 278 CPWL_Note_Contents* m_pContents; |
| 279 private: | 279 |
| 280 void* m_pPriva
teData; | 280 private: |
| 281 FX_SYSTEMTIME m_dtNote; | 281 void* m_pPrivateData; |
| 282 CFX_WideString m_sAuthor; | 282 FX_SYSTEMTIME m_dtNote; |
| 283 | 283 CFX_WideString m_sAuthor; |
| 284 FX_FLOAT m_fOldIt
emHeight; | 284 |
| 285 FX_BOOL m_bSizeC
hanged; | 285 FX_FLOAT m_fOldItemHeight; |
| 286 FX_BOOL m_bAllow
Modify; | 286 FX_BOOL m_bSizeChanged; |
| 287 }; | 287 FX_BOOL m_bAllowModify; |
| 288 | 288 }; |
| 289 class PWL_CLASS CPWL_Note : public CPWL_NoteItem | 289 |
| 290 { | 290 class PWL_CLASS CPWL_Note : public CPWL_NoteItem { |
| 291 public: | 291 public: |
| 292 CPWL_Note(IPopup_Note* pPopupNote, IPWL_NoteNotify* pNoteNotify, IPWL_No
teHandler* pNoteHandler); | 292 CPWL_Note(IPopup_Note* pPopupNote, |
| 293 virtual ~CPWL_Note(); | 293 IPWL_NoteNotify* pNoteNotify, |
| 294 | 294 IPWL_NoteHandler* pNoteHandler); |
| 295 public: | 295 virtual ~CPWL_Note(); |
| 296 virtual void SetSubjectName(c
onst CFX_WideString& sName); | 296 |
| 297 virtual void SetAuthorName(co
nst CFX_WideString& sName); | 297 public: |
| 298 virtual CFX_WideString GetAuthorName() const; | 298 virtual void SetSubjectName(const CFX_WideString& sName); |
| 299 virtual void SetBkColor(const
CPWL_Color& color); | 299 virtual void SetAuthorName(const CFX_WideString& sName); |
| 300 virtual void ResetSubjectName
(FX_INT32 nItemIndex){} | 300 virtual CFX_WideString GetAuthorName() const; |
| 301 virtual FX_BOOL IsTopItem() cons
t {return TRUE;} | 301 virtual void SetBkColor(const CPWL_Color& color); |
| 302 virtual const CPWL_Note* GetNote() const; | 302 virtual void ResetSubjectName(FX_INT32 nItemIndex) {} |
| 303 virtual IPWL_NoteNotify* GetNoteNotify() const; | 303 virtual FX_BOOL IsTopItem() const { return TRUE; } |
| 304 | 304 virtual const CPWL_Note* GetNote() const; |
| 305 public: | 305 virtual IPWL_NoteNotify* GetNoteNotify() const; |
| 306 IPWL_NoteItem* Reply(); | 306 |
| 307 void EnableNo
tify(FX_BOOL bEnabled); | 307 public: |
| 308 void SetIconT
ype(FX_INT32 nType); | 308 IPWL_NoteItem* Reply(); |
| 309 void SetOptio
nsText(const CFX_WideString& sText); | 309 void EnableNotify(FX_BOOL bEnabled); |
| 310 void EnableRe
ad(FX_BOOL bEnabled); | 310 void SetIconType(FX_INT32 nType); |
| 311 void EnableMo
dify(FX_BOOL bEnabled); | 311 void SetOptionsText(const CFX_WideString& sText); |
| 312 | 312 void EnableRead(FX_BOOL bEnabled); |
| 313 CFX_WideString GetReplyString()
const; | 313 void EnableModify(FX_BOOL bEnabled); |
| 314 void SetReply
String(const CFX_WideString& string); | 314 |
| 315 | 315 CFX_WideString GetReplyString() const; |
| 316 //0-normal / 1-caption / 2-leftbottom corner / 3-rightbottom corner / 4-
close / 5-options | 316 void SetReplyString(const CFX_WideString& string); |
| 317 FX_INT32 NoteHitT
est(const CPDF_Point& point) const; | 317 |
| 318 CPDF_Rect GetCapti
onRect() const {return m_rcCaption;} | 318 // 0-normal / 1-caption / 2-leftbottom corner / 3-rightbottom corner / 4-close |
| 319 IPopup_Note* GetPopupNote() c
onst {return m_pPopupNote;} | 319 // / 5-options |
| 320 | 320 FX_INT32 NoteHitTest(const CPDF_Point& point) const; |
| 321 public: | 321 CPDF_Rect GetCaptionRect() const { return m_rcCaption; } |
| 322 virtual FX_BOOL OnLButtonDown(co
nst CPDF_Point & point, FX_DWORD nFlag); | 322 IPopup_Note* GetPopupNote() const { return m_pPopupNote; } |
| 323 virtual FX_BOOL OnRButtonUp(cons
t CPDF_Point & point, FX_DWORD nFlag); | 323 |
| 324 virtual FX_BOOL OnMouseWheel(sho
rt zDelta, const CPDF_Point & point, FX_DWORD nFlag); | 324 public: |
| 325 | 325 virtual FX_BOOL OnLButtonDown(const CPDF_Point& point, FX_DWORD nFlag); |
| 326 protected: | 326 virtual FX_BOOL OnRButtonUp(const CPDF_Point& point, FX_DWORD nFlag); |
| 327 virtual void RePosChildWnd(); | 327 virtual FX_BOOL OnMouseWheel(short zDelta, |
| 328 virtual void CreateChildWnd(c
onst PWL_CREATEPARAM & cp); | 328 const CPDF_Point& point, |
| 329 | 329 FX_DWORD nFlag); |
| 330 virtual void OnNotify(CPWL_Wn
d* pWnd, FX_DWORD msg, FX_INTPTR wParam = 0, FX_INTPTR lParam = 0); | 330 |
| 331 | 331 protected: |
| 332 FX_BOOL ResetScr
ollBar(); | 332 virtual void RePosChildWnd(); |
| 333 void RePosNot
eChildren(); | 333 virtual void CreateChildWnd(const PWL_CREATEPARAM& cp); |
| 334 FX_BOOL ScrollBa
rShouldVisible(); | 334 |
| 335 | 335 virtual void OnNotify(CPWL_Wnd* pWnd, |
| 336 private: | 336 FX_DWORD msg, |
| 337 CPWL_Label* m_pAutho
r; | 337 FX_INTPTR wParam = 0, |
| 338 CPWL_Note_Icon* m_pIcon; | 338 FX_INTPTR lParam = 0); |
| 339 CPWL_Note_CloseBox* m_pCloseBox; | 339 |
| 340 CPWL_Note_LBBox* m_pLBBox; | 340 FX_BOOL ResetScrollBar(); |
| 341 CPWL_Note_RBBox* m_pRBBox; | 341 void RePosNoteChildren(); |
| 342 CPWL_ScrollBar* m_pContentsBar; | 342 FX_BOOL ScrollBarShouldVisible(); |
| 343 CPWL_Note_Options* m_pOptions; | 343 |
| 344 IPWL_NoteNotify* m_pNoteNotify; | 344 private: |
| 345 FX_BOOL m_bResiz
ing; | 345 CPWL_Label* m_pAuthor; |
| 346 PWL_SCROLL_INFO m_OldScrollInfo; | 346 CPWL_Note_Icon* m_pIcon; |
| 347 CPDF_Rect m_rcCapt
ion; | 347 CPWL_Note_CloseBox* m_pCloseBox; |
| 348 FX_BOOL m_bEnalb
leNotify; | 348 CPWL_Note_LBBox* m_pLBBox; |
| 349 IPopup_Note* m_pPopupNote; | 349 CPWL_Note_RBBox* m_pRBBox; |
| 350 CFX_WideString m_sReplyString; | 350 CPWL_ScrollBar* m_pContentsBar; |
| 351 CPWL_Note_Options* m_pOptions; |
| 352 IPWL_NoteNotify* m_pNoteNotify; |
| 353 FX_BOOL m_bResizing; |
| 354 PWL_SCROLL_INFO m_OldScrollInfo; |
| 355 CPDF_Rect m_rcCaption; |
| 356 FX_BOOL m_bEnalbleNotify; |
| 357 IPopup_Note* m_pPopupNote; |
| 358 CFX_WideString m_sReplyString; |
| 351 }; | 359 }; |
| 352 | 360 |
| 353 #endif | 361 #endif |
| 354 | |
| OLD | NEW |