Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2972 lines
80 KiB

  1. //
  2. // candprop.cpp
  3. //
  4. #include "private.h"
  5. #include "globals.h"
  6. #include "mscandui.h"
  7. #include "candprop.h"
  8. #include "candobj.h"
  9. #include "candutil.h"
  10. #include "candui.h"
  11. #include "wcand.h"
  12. /*============================================================================*/
  13. /* */
  14. /* C C A N D U I O B J E C T P R O P E R T Y */
  15. /* */
  16. /*============================================================================*/
  17. /* C C A N D U I O B J E C T P R O P E R T Y */
  18. /*------------------------------------------------------------------------------
  19. ------------------------------------------------------------------------------*/
  20. CCandUIObjectProperty::CCandUIObjectProperty( CCandUIPropertyMgr *pPropMgr )
  21. {
  22. m_pPropMgr = pPropMgr;
  23. m_flags.fAllowEnable = FALSE;
  24. m_flags.fAllowDisable = FALSE;
  25. m_flags.fAllowIsEnabled = FALSE;
  26. m_flags.fAllowShow = FALSE;
  27. m_flags.fAllowHide = FALSE;
  28. m_flags.fAllowIsVisible = FALSE;
  29. m_flags.fAllowSetPosition = FALSE;
  30. m_flags.fAllowGetPosition = FALSE;
  31. m_flags.fAllowSetSize = FALSE;
  32. m_flags.fAllowGetSize = FALSE;
  33. m_flags.fAllowSetFont = FALSE;
  34. m_flags.fAllowGetFont = FALSE;
  35. m_flags.fAllowSetText = FALSE;
  36. m_flags.fAllowGetText = FALSE;
  37. m_flags.fAllowSetToolTip = FALSE;
  38. m_flags.fAllowGetToolTip = FALSE;
  39. }
  40. /* ~ C C A N D U I O B J E C T P R O P E R T Y */
  41. /*------------------------------------------------------------------------------
  42. ------------------------------------------------------------------------------*/
  43. CCandUIObjectProperty::~CCandUIObjectProperty( void )
  44. {
  45. }
  46. /* E N A B L E */
  47. /*------------------------------------------------------------------------------
  48. ------------------------------------------------------------------------------*/
  49. HRESULT CCandUIObjectProperty::Enable( void )
  50. {
  51. HRESULT hr;
  52. if (!m_flags.fAllowEnable) {
  53. return E_FAIL;
  54. }
  55. hr = m_propEnabled.Set( TRUE );
  56. if (hr == S_OK) {
  57. NotifyUpdate( CANDUIPROPEV_UPDATEENABLESTATE );
  58. }
  59. return (SUCCEEDED(hr) ? S_OK : hr);
  60. }
  61. /* D I S A B L E */
  62. /*------------------------------------------------------------------------------
  63. ------------------------------------------------------------------------------*/
  64. HRESULT CCandUIObjectProperty::Disable( void )
  65. {
  66. HRESULT hr;
  67. if (!m_flags.fAllowDisable) {
  68. return E_FAIL;
  69. }
  70. hr = m_propEnabled.Set( FALSE );
  71. if (hr == S_OK) {
  72. NotifyUpdate( CANDUIPROPEV_UPDATEENABLESTATE );
  73. }
  74. return (SUCCEEDED(hr) ? S_OK : hr);
  75. }
  76. /* I S E N A B L E D */
  77. /*------------------------------------------------------------------------------
  78. ------------------------------------------------------------------------------*/
  79. HRESULT CCandUIObjectProperty::IsEnabled( BOOL *pfEnabled )
  80. {
  81. if (!m_flags.fAllowIsEnabled) {
  82. return E_FAIL;
  83. }
  84. return m_propEnabled.Get( pfEnabled );
  85. }
  86. /* S H O W */
  87. /*------------------------------------------------------------------------------
  88. ------------------------------------------------------------------------------*/
  89. HRESULT CCandUIObjectProperty::Show( void )
  90. {
  91. HRESULT hr;
  92. if (!m_flags.fAllowShow) {
  93. return E_FAIL;
  94. }
  95. hr = m_propVisible.Set( TRUE );
  96. if (hr == S_OK) {
  97. NotifyUpdate( CANDUIPROPEV_UPDATEVISIBLESTATE );
  98. }
  99. return (SUCCEEDED(hr) ? S_OK : hr);
  100. }
  101. /* H I D E */
  102. /*------------------------------------------------------------------------------
  103. ------------------------------------------------------------------------------*/
  104. HRESULT CCandUIObjectProperty::Hide( void )
  105. {
  106. HRESULT hr;
  107. if (!m_flags.fAllowHide) {
  108. return E_FAIL;
  109. }
  110. hr = m_propVisible.Set( FALSE );
  111. if (hr == S_OK) {
  112. NotifyUpdate( CANDUIPROPEV_UPDATEVISIBLESTATE );
  113. }
  114. return (SUCCEEDED(hr) ? S_OK : hr);
  115. }
  116. /* I S V I S I B L E */
  117. /*------------------------------------------------------------------------------
  118. ------------------------------------------------------------------------------*/
  119. HRESULT CCandUIObjectProperty::IsVisible( BOOL *pfVisible )
  120. {
  121. if (!m_flags.fAllowIsVisible) {
  122. return E_FAIL;
  123. }
  124. return m_propVisible.Get( pfVisible );
  125. }
  126. /* S E T P O S I T I O N */
  127. /*------------------------------------------------------------------------------
  128. ------------------------------------------------------------------------------*/
  129. HRESULT CCandUIObjectProperty::SetPosition( POINT *pptPos )
  130. {
  131. HRESULT hr;
  132. if (!m_flags.fAllowSetPosition) {
  133. return E_FAIL;
  134. }
  135. hr = m_propPos.Set( pptPos );
  136. if (hr == S_OK) {
  137. NotifyUpdate( CANDUIPROPEV_UPDATEPOSITION );
  138. }
  139. return (SUCCEEDED(hr) ? S_OK : hr);
  140. }
  141. /* G E T P O S I T I O N */
  142. /*------------------------------------------------------------------------------
  143. ------------------------------------------------------------------------------*/
  144. HRESULT CCandUIObjectProperty::GetPosition( POINT *pptPos )
  145. {
  146. if (!m_flags.fAllowGetPosition) {
  147. return E_FAIL;
  148. }
  149. return m_propPos.Get( pptPos );
  150. }
  151. /* S E T S I Z E */
  152. /*------------------------------------------------------------------------------
  153. ------------------------------------------------------------------------------*/
  154. HRESULT CCandUIObjectProperty::SetSize( SIZE *psize )
  155. {
  156. HRESULT hr;
  157. if (!m_flags.fAllowSetSize) {
  158. return E_FAIL;
  159. }
  160. hr = m_propSize.Set( psize );
  161. if (hr == S_OK) {
  162. NotifyUpdate( CANDUIPROPEV_UPDATESIZE );
  163. }
  164. return (SUCCEEDED(hr) ? S_OK : hr);
  165. }
  166. /* G E T S I Z E */
  167. /*------------------------------------------------------------------------------
  168. ------------------------------------------------------------------------------*/
  169. HRESULT CCandUIObjectProperty::GetSize( SIZE *psize )
  170. {
  171. if (!m_flags.fAllowGetSize) {
  172. return E_FAIL;
  173. }
  174. return m_propSize.Get( psize );
  175. }
  176. /* S E T F O N T */
  177. /*------------------------------------------------------------------------------
  178. ------------------------------------------------------------------------------*/
  179. HRESULT CCandUIObjectProperty::SetFont( LOGFONTW *plf )
  180. {
  181. HRESULT hr;
  182. if (!m_flags.fAllowSetFont) {
  183. return E_FAIL;
  184. }
  185. hr = m_propFont.Set( plf );
  186. if (hr == S_OK) {
  187. NotifyUpdate( CANDUIPROPEV_UPDATEFONT );
  188. }
  189. return (SUCCEEDED(hr) ? S_OK : hr);
  190. }
  191. /* G E T F O N T */
  192. /*------------------------------------------------------------------------------
  193. ------------------------------------------------------------------------------*/
  194. HRESULT CCandUIObjectProperty::GetFont( LOGFONTW *plf )
  195. {
  196. if (!m_flags.fAllowGetFont) {
  197. return E_FAIL;
  198. }
  199. return m_propFont.Get( plf );
  200. }
  201. /* S E T T E X T */
  202. /*------------------------------------------------------------------------------
  203. ------------------------------------------------------------------------------*/
  204. HRESULT CCandUIObjectProperty::SetText( BSTR bstr )
  205. {
  206. HRESULT hr;
  207. if (!m_flags.fAllowSetText) {
  208. return E_FAIL;
  209. }
  210. hr = m_propText.Set( bstr );
  211. if (hr == S_OK) {
  212. NotifyUpdate( CANDUIPROPEV_UPDATETEXT );
  213. }
  214. return (SUCCEEDED(hr) ? S_OK : hr);
  215. }
  216. /* G E T T E X T */
  217. /*------------------------------------------------------------------------------
  218. ------------------------------------------------------------------------------*/
  219. HRESULT CCandUIObjectProperty::GetText( BSTR *pbstr )
  220. {
  221. if (!m_flags.fAllowGetText) {
  222. return E_FAIL;
  223. }
  224. return m_propText.Get( pbstr );
  225. }
  226. /* S E T T O O L T I P S T R I N G */
  227. /*------------------------------------------------------------------------------
  228. ------------------------------------------------------------------------------*/
  229. HRESULT CCandUIObjectProperty::SetToolTipString( BSTR bstr )
  230. {
  231. HRESULT hr;
  232. if (!m_flags.fAllowSetToolTip) {
  233. return E_FAIL;
  234. }
  235. hr = m_propToolTip.Set( bstr );
  236. if (hr == S_OK) {
  237. NotifyUpdate( CANDUIPROPEV_UPDATETOOLTIP );
  238. }
  239. return (SUCCEEDED(hr) ? S_OK : hr);
  240. }
  241. /* G E T T O O L T I P S T R I N G */
  242. /*------------------------------------------------------------------------------
  243. ------------------------------------------------------------------------------*/
  244. HRESULT CCandUIObjectProperty::GetToolTipString( BSTR *pbstr )
  245. {
  246. if (!m_flags.fAllowGetToolTip) {
  247. return E_FAIL;
  248. }
  249. return m_propToolTip.Get( pbstr );
  250. }
  251. /* I S E N A B L E D */
  252. /*------------------------------------------------------------------------------
  253. ------------------------------------------------------------------------------*/
  254. BOOL CCandUIObjectProperty::IsEnabled( void )
  255. {
  256. return m_propEnabled.Get();
  257. }
  258. /* I S V I S I B L E */
  259. /*------------------------------------------------------------------------------
  260. ------------------------------------------------------------------------------*/
  261. BOOL CCandUIObjectProperty::IsVisible( void )
  262. {
  263. return m_propVisible.Get();
  264. }
  265. /* G E T F O N T */
  266. /*------------------------------------------------------------------------------
  267. ------------------------------------------------------------------------------*/
  268. HFONT CCandUIObjectProperty::GetFont( void )
  269. {
  270. return m_propFont.Get();
  271. }
  272. /* G E T T E X T */
  273. /*------------------------------------------------------------------------------
  274. ------------------------------------------------------------------------------*/
  275. LPCWSTR CCandUIObjectProperty::GetText( void )
  276. {
  277. return m_propText.Get();
  278. }
  279. /* G E T T O O L T I P S T R I N G */
  280. /*------------------------------------------------------------------------------
  281. ------------------------------------------------------------------------------*/
  282. LPCWSTR CCandUIObjectProperty::GetToolTipString( void )
  283. {
  284. return m_propToolTip.Get();
  285. }
  286. /* O N P R O P E R T Y U P D A T E D */
  287. /*------------------------------------------------------------------------------
  288. ------------------------------------------------------------------------------*/
  289. void CCandUIObjectProperty::OnPropertyUpdated( CANDUIPROPERTY prop, CANDUIPROPERTYEVENT event )
  290. {
  291. }
  292. /* N O T I F Y U P D A T E */
  293. /*------------------------------------------------------------------------------
  294. ------------------------------------------------------------------------------*/
  295. void CCandUIObjectProperty::NotifyUpdate( CANDUIPROPERTYEVENT event )
  296. {
  297. GetPropertyMgr()->NotifyPropertyUpdate( GetPropType(), event );
  298. }
  299. /*============================================================================*/
  300. /* */
  301. /* C C A N D W I N D O W P R O P E R T Y */
  302. /* */
  303. /*============================================================================*/
  304. /* C C A N D W I N D O W P R O P E R T Y */
  305. /*------------------------------------------------------------------------------
  306. Constructor of CCandWindowProperty
  307. ------------------------------------------------------------------------------*/
  308. CCandWindowProperty::CCandWindowProperty( CCandUIPropertyMgr *pPropMgr ) : CCandUIObjectProperty( pPropMgr )
  309. {
  310. m_flags.fAllowEnable = FALSE;
  311. m_flags.fAllowDisable = FALSE;
  312. m_flags.fAllowIsEnabled = FALSE;
  313. m_flags.fAllowShow = TRUE;
  314. m_flags.fAllowHide = TRUE;
  315. m_flags.fAllowIsVisible = TRUE;
  316. m_flags.fAllowSetPosition = TRUE;
  317. m_flags.fAllowGetPosition = TRUE;
  318. m_flags.fAllowSetSize = FALSE;
  319. m_flags.fAllowGetSize = TRUE;
  320. m_flags.fAllowSetFont = FALSE;
  321. m_flags.fAllowGetFont = FALSE;
  322. m_flags.fAllowSetText = FALSE;
  323. m_flags.fAllowGetText = FALSE;
  324. m_flags.fAllowSetToolTip = FALSE;
  325. m_flags.fAllowGetToolTip = FALSE;
  326. m_propEnabled.Set( TRUE );
  327. m_propVisible.Set( TRUE );
  328. m_propFont.Set( NULL );
  329. m_propText.Set( NULL );
  330. m_propToolTip.Set( NULL );
  331. m_uidir = CANDUIDIR_TOPTOBOTTOM;
  332. m_propAutoMoveEnabled.Set( TRUE );
  333. m_hWnd = NULL;
  334. //
  335. CCandUIObjectEventSink::InitEventSink( pPropMgr->GetCandidateUI()->GetUIObjectMgr() );
  336. }
  337. /* ~ C C A N D W I N D O W P R O P E R T Y */
  338. /*------------------------------------------------------------------------------
  339. Destructor of CCandWindowProperty
  340. ------------------------------------------------------------------------------*/
  341. CCandWindowProperty::~CCandWindowProperty( void )
  342. {
  343. CCandUIObjectEventSink::DoneEventSink();
  344. }
  345. /* G E T W I N D O W */
  346. /*------------------------------------------------------------------------------
  347. ------------------------------------------------------------------------------*/
  348. HRESULT CCandWindowProperty::GetWindow( HWND *phWnd )
  349. {
  350. if (phWnd == NULL) {
  351. return E_INVALIDARG;
  352. }
  353. *phWnd = m_hWnd;
  354. return (*phWnd != NULL) ? S_OK : E_FAIL;
  355. }
  356. /* S E T U I D I R E C T I O N */
  357. /*------------------------------------------------------------------------------
  358. ------------------------------------------------------------------------------*/
  359. HRESULT CCandWindowProperty::SetUIDirection( CANDUIUIDIRECTION uidir )
  360. {
  361. if (m_uidir != uidir) {
  362. m_uidir = uidir;
  363. NotifyUpdate( CANDUIPROPEV_UPDATETEXTFLOW );
  364. }
  365. return S_OK;
  366. }
  367. /* G E T U I D I R E C T I O N */
  368. /*------------------------------------------------------------------------------
  369. ------------------------------------------------------------------------------*/
  370. HRESULT CCandWindowProperty::GetUIDirection( CANDUIUIDIRECTION *puidir )
  371. {
  372. if (puidir == NULL) {
  373. return E_INVALIDARG;
  374. }
  375. *puidir = m_uidir;
  376. return S_OK;
  377. }
  378. /* E N A B L E A U T O M O V E */
  379. /*------------------------------------------------------------------------------
  380. ------------------------------------------------------------------------------*/
  381. HRESULT CCandWindowProperty::EnableAutoMove( BOOL fEnable )
  382. {
  383. return m_propAutoMoveEnabled.Set( fEnable );
  384. }
  385. /* I S A U T O M O V E E N A B L E D */
  386. /*------------------------------------------------------------------------------
  387. ------------------------------------------------------------------------------*/
  388. HRESULT CCandWindowProperty::IsAutoMoveEnabled( BOOL *pfEnabled )
  389. {
  390. return m_propAutoMoveEnabled.Get( pfEnabled );
  391. }
  392. /* G E T U I D I R E C T I O N */
  393. /*------------------------------------------------------------------------------
  394. ------------------------------------------------------------------------------*/
  395. CANDUIUIDIRECTION CCandWindowProperty::GetUIDirection( void )
  396. {
  397. return m_uidir;
  398. }
  399. /* I S A U T O M O V E E N A B L E D */
  400. /*------------------------------------------------------------------------------
  401. ------------------------------------------------------------------------------*/
  402. BOOL CCandWindowProperty::IsAutoMoveEnabled( void )
  403. {
  404. return m_propAutoMoveEnabled.Get();
  405. }
  406. /* O N O B J E C T E V E N T */
  407. /*------------------------------------------------------------------------------
  408. ------------------------------------------------------------------------------*/
  409. void CCandWindowProperty::OnObjectEvent( CANDUIOBJECT obj, CANDUIOBJECTEVENT event )
  410. {
  411. if (obj != CANDUIOBJ_CANDWINDOW) {
  412. return;
  413. }
  414. switch (event) {
  415. case CANDUIOBJEV_CREATED: {
  416. if (GetUIObjectMgr()->GetCandWindowObj()) {
  417. RECT rc;
  418. m_hWnd = GetUIObjectMgr()->GetCandWindowObj()->GetWnd();
  419. GetWindowRect( m_hWnd, &rc );
  420. m_propPos.Set( rc.left, rc.top );
  421. m_propSize.Set( rc.right - rc.left, rc.bottom - rc.top );
  422. }
  423. else {
  424. m_hWnd = NULL;
  425. m_propPos.Set( 0, 0 );
  426. m_propSize.Set( 0, 0 );
  427. }
  428. break;
  429. }
  430. case CANDUIOBJEV_DESTROYED: {
  431. m_hWnd = NULL;
  432. m_propPos.Set( 0, 0 );
  433. m_propSize.Set( 0, 0 );
  434. break;
  435. }
  436. case CANDUIOBJEV_UPDATED: {
  437. RECT rc;
  438. GetWindowRect( m_hWnd, &rc );
  439. m_propPos.Set( rc.left, rc.top );
  440. m_propSize.Set( rc.right - rc.left, rc.bottom - rc.top );
  441. break;
  442. }
  443. }
  444. }
  445. /* C R E A T E I N T E R F A C E O B J E C T */
  446. /*------------------------------------------------------------------------------
  447. ------------------------------------------------------------------------------*/
  448. HRESULT CCandWindowProperty::CreateInterfaceObject( REFIID riid, void **ppvObj )
  449. {
  450. CCandUICandWindow *pObject;
  451. HRESULT hr;
  452. pObject = new CCandUICandWindow( this );
  453. if (pObject == NULL) {
  454. return E_OUTOFMEMORY;
  455. }
  456. hr = pObject->QueryInterface( riid, ppvObj );
  457. pObject->Release();
  458. return hr;
  459. }
  460. /*============================================================================*/
  461. /* */
  462. /* C C A N D L I S T B O X P R O P E R T Y */
  463. /* */
  464. /*============================================================================*/
  465. /* C C A N D L I S T B O X P R O P E R T Y */
  466. /*------------------------------------------------------------------------------
  467. Constructor of CCandListBoxProperty
  468. ------------------------------------------------------------------------------*/
  469. CCandListBoxProperty::CCandListBoxProperty( CCandUIPropertyMgr *pPropMgr ) : CCandUIObjectProperty( pPropMgr )
  470. {
  471. m_flags.fAllowEnable = FALSE;
  472. m_flags.fAllowDisable = FALSE;
  473. m_flags.fAllowIsEnabled = FALSE;
  474. m_flags.fAllowShow = FALSE;
  475. m_flags.fAllowHide = FALSE;
  476. m_flags.fAllowIsVisible = FALSE;
  477. m_flags.fAllowSetPosition = FALSE;
  478. m_flags.fAllowGetPosition = TRUE;
  479. m_flags.fAllowSetSize = FALSE;
  480. m_flags.fAllowGetSize = TRUE;
  481. m_flags.fAllowSetFont = FALSE;
  482. m_flags.fAllowGetFont = FALSE;
  483. m_flags.fAllowSetText = FALSE;
  484. m_flags.fAllowGetText = FALSE;
  485. m_flags.fAllowSetToolTip = FALSE;
  486. m_flags.fAllowGetToolTip = FALSE;
  487. m_propEnabled.Set( TRUE );
  488. m_propVisible.Set( TRUE );
  489. m_propPos.Set( 0, 0 );
  490. m_propSize.Set( 0, 0 );
  491. m_propFont.Set( NULL );
  492. m_propText.Set( NULL );
  493. m_propToolTip.Set( NULL );
  494. m_propHeight.Set( -1 );
  495. CCandUIObjectEventSink::InitEventSink( pPropMgr->GetCandidateUI()->GetUIObjectMgr() );
  496. }
  497. /* ~ C C A N D L I S T B O X P R O P E R T Y */
  498. /*------------------------------------------------------------------------------
  499. Destructor of CCandListBoxProperty
  500. ------------------------------------------------------------------------------*/
  501. CCandListBoxProperty::~CCandListBoxProperty( void )
  502. {
  503. CCandUIObjectEventSink::DoneEventSink();
  504. }
  505. /* S E T H E I G H T */
  506. /*------------------------------------------------------------------------------
  507. ------------------------------------------------------------------------------*/
  508. HRESULT CCandListBoxProperty::SetHeight( LONG lLines )
  509. {
  510. HRESULT hr;
  511. if ((lLines != -1) && ((lLines < 1) || (9 <lLines))) {
  512. return E_INVALIDARG;
  513. }
  514. hr = m_propHeight.Set( lLines );
  515. if (hr == S_OK) {
  516. NotifyUpdate( CANDUIPROPEV_UPDATECANDLINES );
  517. }
  518. return (SUCCEEDED(hr) ? S_OK : hr);
  519. }
  520. /* G E T H E I G H T */
  521. /*------------------------------------------------------------------------------
  522. ------------------------------------------------------------------------------*/
  523. HRESULT CCandListBoxProperty::GetHeight( LONG *plLines )
  524. {
  525. return m_propHeight.Get( plLines );
  526. }
  527. /* G E T C A N D I D A T E S T R I N G R E C T */
  528. /*------------------------------------------------------------------------------
  529. ------------------------------------------------------------------------------*/
  530. HRESULT CCandListBoxProperty::GetCandidateStringRect( ULONG nIndex, RECT *prc )
  531. {
  532. HRESULT hr;
  533. int iCandItem;
  534. if (prc == NULL) {
  535. return E_INVALIDARG;
  536. }
  537. // check if candidate list has been set
  538. if (GetPropertyMgr()->GetCandidateUI()->GetCandListMgr()->GetCandList() == NULL) {
  539. return E_FAIL;
  540. }
  541. // map index to icanditem
  542. hr = GetPropertyMgr()->GetCandidateUI()->GetCandListMgr()->GetCandList()->MapIndexToIItem( nIndex, &iCandItem );
  543. if (FAILED(hr)) {
  544. return E_FAIL;
  545. }
  546. // get item rect
  547. if (GetUIObjectMgr()->GetCandWindowObj() && GetUIObjectMgr()->GetCandListBoxObj()) {
  548. ULONG iListItem = GetUIObjectMgr()->GetCandWindowObj()->ListItemFromCandItem( iCandItem );
  549. GetUIObjectMgr()->GetCandListBoxObj()->GetItemRect( iListItem, prc );
  550. return S_OK;
  551. }
  552. return E_FAIL;
  553. }
  554. /* G E T H E I G H T */
  555. /*------------------------------------------------------------------------------
  556. ------------------------------------------------------------------------------*/
  557. LONG CCandListBoxProperty::GetHeight( void )
  558. {
  559. return m_propHeight.Get();
  560. }
  561. /* O N O B J E C T E V E N T */
  562. /*------------------------------------------------------------------------------
  563. ------------------------------------------------------------------------------*/
  564. void CCandListBoxProperty::OnObjectEvent( CANDUIOBJECT obj, CANDUIOBJECTEVENT event )
  565. {
  566. if (obj != CANDUIOBJ_CANDLISTBOX) {
  567. return;
  568. }
  569. switch (event) {
  570. case CANDUIOBJEV_CREATED: {
  571. break;
  572. }
  573. case CANDUIOBJEV_DESTROYED: {
  574. m_propPos.Set( 0, 0 );
  575. m_propSize.Set( 0, 0 );
  576. break;
  577. }
  578. case CANDUIOBJEV_UPDATED: {
  579. CUIFCandListBase *pUIObject = GetUIObjectMgr()->GetCandListBoxObj();
  580. if ((pUIObject != NULL) && pUIObject->IsVisible()) {
  581. RECT rc;
  582. pUIObject->GetRect( &rc );
  583. m_propPos.Set( rc.left, rc.top );
  584. m_propSize.Set( rc.right - rc.left, rc.bottom - rc.top );
  585. }
  586. else {
  587. m_propPos.Set( 0, 0 );
  588. m_propSize.Set( 0, 0 );
  589. }
  590. break;
  591. }
  592. }
  593. }
  594. /* C R E A T E I N T E R F A C E O B J E C T */
  595. /*------------------------------------------------------------------------------
  596. ------------------------------------------------------------------------------*/
  597. HRESULT CCandListBoxProperty::CreateInterfaceObject( REFIID riid, void **ppvObj )
  598. {
  599. CCandUICandListBox *pObject;
  600. HRESULT hr;
  601. pObject = new CCandUICandListBox( this );
  602. if (pObject == NULL) {
  603. return E_OUTOFMEMORY;
  604. }
  605. hr = pObject->QueryInterface( riid, ppvObj );
  606. pObject->Release();
  607. return hr;
  608. }
  609. /*============================================================================*/
  610. /* */
  611. /* C C A N D S T R I N G P R O P E R T Y */
  612. /* */
  613. /*============================================================================*/
  614. /* C C A N D S T R I N G P R O P E R T Y */
  615. /*------------------------------------------------------------------------------
  616. Constructor of CCandStringProperty
  617. ------------------------------------------------------------------------------*/
  618. CCandStringProperty::CCandStringProperty( CCandUIPropertyMgr *pPropMgr ) : CCandUIObjectProperty( pPropMgr )
  619. {
  620. LOGFONTW lf;
  621. GetNonClientLogFont( NCFONT_MENU, &lf );
  622. m_flags.fAllowEnable = FALSE;
  623. m_flags.fAllowDisable = FALSE;
  624. m_flags.fAllowIsEnabled = FALSE;
  625. m_flags.fAllowShow = FALSE;
  626. m_flags.fAllowHide = FALSE;
  627. m_flags.fAllowIsVisible = FALSE;
  628. m_flags.fAllowSetPosition = FALSE;
  629. m_flags.fAllowGetPosition = FALSE;
  630. m_flags.fAllowSetSize = FALSE;
  631. m_flags.fAllowGetSize = FALSE;
  632. m_flags.fAllowSetFont = TRUE;
  633. m_flags.fAllowGetFont = TRUE;
  634. m_flags.fAllowSetText = FALSE;
  635. m_flags.fAllowGetText = FALSE;
  636. m_flags.fAllowSetToolTip = FALSE;
  637. m_flags.fAllowGetToolTip = FALSE;
  638. m_propEnabled.Set( TRUE );
  639. m_propVisible.Set( TRUE );
  640. m_propFont.Set( &lf );
  641. m_propFont.SetOrientation( PROPFONTORT_ORT0 );
  642. m_propText.Set( NULL );
  643. m_propToolTip.Set( NULL );
  644. }
  645. /* ~ C C A N D S T R I N G P R O P E R T Y */
  646. /*------------------------------------------------------------------------------
  647. Destructor of CCandStringProperty
  648. ------------------------------------------------------------------------------*/
  649. CCandStringProperty::~CCandStringProperty( void )
  650. {
  651. }
  652. /* O N P R O P E R T Y U P D A T E D */
  653. /*------------------------------------------------------------------------------
  654. ------------------------------------------------------------------------------*/
  655. void CCandStringProperty::OnPropertyUpdated( CANDUIPROPERTY prop, CANDUIPROPERTYEVENT event )
  656. {
  657. // change font direction when UI direction is changed
  658. if ((prop == CANDUIPROP_CANDWINDOW) && (event == CANDUIPROPEV_UPDATETEXTFLOW)) {
  659. CANDUIUIDIRECTION uidir = GetPropertyMgr()->GetCandWindowProp()->GetUIDirection();
  660. PROPFONTORIENTATION ort;
  661. switch (uidir) {
  662. default:
  663. case CANDUIDIR_TOPTOBOTTOM: {
  664. ort = PROPFONTORT_ORT0;
  665. break;
  666. }
  667. case CANDUIDIR_BOTTOMTOTOP: {
  668. ort = PROPFONTORT_ORT180;
  669. break;
  670. }
  671. case CANDUIDIR_RIGHTTOLEFT: {
  672. ort = PROPFONTORT_ORT270;
  673. break;
  674. }
  675. case CANDUIDIR_LEFTTORIGHT: {
  676. ort = PROPFONTORT_ORT90;
  677. break;
  678. }
  679. }
  680. m_propFont.SetOrientation( ort );
  681. }
  682. }
  683. /* C R E A T E I N T E R F A C E O B J E C T */
  684. /*------------------------------------------------------------------------------
  685. ------------------------------------------------------------------------------*/
  686. HRESULT CCandStringProperty::CreateInterfaceObject( REFIID riid, void **ppvObj )
  687. {
  688. CCandUICandString *pObject;
  689. HRESULT hr;
  690. pObject = new CCandUICandString( this );
  691. if (pObject == NULL) {
  692. return E_OUTOFMEMORY;
  693. }
  694. hr = pObject->QueryInterface( riid, ppvObj );
  695. pObject->Release();
  696. return hr;
  697. }
  698. /*============================================================================*/
  699. /* */
  700. /* C I N L I N E C O M M E N T P R O P E R T Y */
  701. /* */
  702. /*============================================================================*/
  703. /* C I N L I N E C O M M E N T P R O P E R T Y */
  704. /*------------------------------------------------------------------------------
  705. Constructor of CInlineCommentProperty
  706. ------------------------------------------------------------------------------*/
  707. CInlineCommentProperty::CInlineCommentProperty( CCandUIPropertyMgr *pPropMgr ) : CCandUIObjectProperty( pPropMgr )
  708. {
  709. LOGFONTW lf;
  710. GetNonClientLogFont( NCFONT_MENU, &lf );
  711. lf.lfHeight = lf.lfHeight * 3 / 4;
  712. m_flags.fAllowEnable = FALSE;
  713. m_flags.fAllowDisable = FALSE;
  714. m_flags.fAllowIsEnabled = FALSE;
  715. m_flags.fAllowShow = FALSE;
  716. m_flags.fAllowHide = FALSE;
  717. m_flags.fAllowIsVisible = FALSE;
  718. m_flags.fAllowSetPosition = FALSE;
  719. m_flags.fAllowGetPosition = FALSE;
  720. m_flags.fAllowSetSize = FALSE;
  721. m_flags.fAllowGetSize = FALSE;
  722. m_flags.fAllowSetFont = TRUE;
  723. m_flags.fAllowGetFont = TRUE;
  724. m_flags.fAllowSetText = FALSE;
  725. m_flags.fAllowGetText = FALSE;
  726. m_flags.fAllowSetToolTip = FALSE;
  727. m_flags.fAllowGetToolTip = FALSE;
  728. m_propEnabled.Set( TRUE );
  729. m_propVisible.Set( TRUE );
  730. m_propFont.Set( &lf );
  731. m_propFont.SetOrientation( PROPFONTORT_ORT0 );
  732. m_propText.Set( NULL );
  733. m_propToolTip.Set( NULL );
  734. }
  735. /* ~ C I N L I N E C O M M E N T P R O P E R T Y */
  736. /*------------------------------------------------------------------------------
  737. Destructor of CInlineCommentProperty
  738. ------------------------------------------------------------------------------*/
  739. CInlineCommentProperty::~CInlineCommentProperty( void )
  740. {
  741. }
  742. /* O N P R O P E R T Y U P D A T E D */
  743. /*------------------------------------------------------------------------------
  744. ------------------------------------------------------------------------------*/
  745. void CInlineCommentProperty::OnPropertyUpdated( CANDUIPROPERTY prop, CANDUIPROPERTYEVENT event )
  746. {
  747. // change font direction when UI direction is changed
  748. if ((prop == CANDUIPROP_CANDWINDOW) && (event == CANDUIPROPEV_UPDATETEXTFLOW)) {
  749. CANDUIUIDIRECTION uidir = GetPropertyMgr()->GetCandWindowProp()->GetUIDirection();
  750. PROPFONTORIENTATION ort;
  751. switch (uidir) {
  752. default:
  753. case CANDUIDIR_TOPTOBOTTOM: {
  754. ort = PROPFONTORT_ORT0;
  755. break;
  756. }
  757. case CANDUIDIR_BOTTOMTOTOP: {
  758. ort = PROPFONTORT_ORT180;
  759. break;
  760. }
  761. case CANDUIDIR_RIGHTTOLEFT: {
  762. ort = PROPFONTORT_ORT270;
  763. break;
  764. }
  765. case CANDUIDIR_LEFTTORIGHT: {
  766. ort = PROPFONTORT_ORT90;
  767. break;
  768. }
  769. }
  770. m_propFont.SetOrientation( ort );
  771. }
  772. }
  773. /* C R E A T E I N T E R F A C E O B J E C T */
  774. /*------------------------------------------------------------------------------
  775. ------------------------------------------------------------------------------*/
  776. HRESULT CInlineCommentProperty::CreateInterfaceObject( REFIID riid, void **ppvObj )
  777. {
  778. CCandUIInlineComment *pObject;
  779. HRESULT hr;
  780. pObject = new CCandUIInlineComment( this );
  781. if (pObject == NULL) {
  782. return E_OUTOFMEMORY;
  783. }
  784. hr = pObject->QueryInterface( riid, ppvObj );
  785. pObject->Release();
  786. return hr;
  787. }
  788. /*============================================================================*/
  789. /* */
  790. /* C C A N D I N D E X P R O P E R T Y */
  791. /* */
  792. /*============================================================================*/
  793. /* C C A N D I N D E X P R O P E R T Y */
  794. /*------------------------------------------------------------------------------
  795. Constructor of CCandIndexProperty
  796. ------------------------------------------------------------------------------*/
  797. CCandIndexProperty::CCandIndexProperty( CCandUIPropertyMgr *pPropMgr ) : CCandUIObjectProperty( pPropMgr )
  798. {
  799. LOGFONTW lf;
  800. GetNonClientLogFont( NCFONT_MENU, &lf );
  801. m_flags.fAllowEnable = FALSE;
  802. m_flags.fAllowDisable = FALSE;
  803. m_flags.fAllowIsEnabled = FALSE;
  804. m_flags.fAllowShow = FALSE;
  805. m_flags.fAllowHide = FALSE;
  806. m_flags.fAllowIsVisible = FALSE;
  807. m_flags.fAllowSetPosition = FALSE;
  808. m_flags.fAllowGetPosition = FALSE;
  809. m_flags.fAllowSetSize = FALSE;
  810. m_flags.fAllowGetSize = FALSE;
  811. m_flags.fAllowSetFont = TRUE;
  812. m_flags.fAllowGetFont = TRUE;
  813. m_flags.fAllowSetText = FALSE;
  814. m_flags.fAllowGetText = FALSE;
  815. m_flags.fAllowSetToolTip = FALSE;
  816. m_flags.fAllowGetToolTip = FALSE;
  817. m_propEnabled.Set( TRUE );
  818. m_propVisible.Set( TRUE );
  819. m_propFont.Set( &lf );
  820. m_propFont.SetOrientation( PROPFONTORT_DONTCARE );
  821. m_propText.Set( NULL );
  822. m_propToolTip.Set( NULL );
  823. }
  824. /* ~ C C A N D I N D E X P R O P E R T Y */
  825. /*------------------------------------------------------------------------------
  826. Destructor of CCandIndexProperty
  827. ------------------------------------------------------------------------------*/
  828. CCandIndexProperty::~CCandIndexProperty( void )
  829. {
  830. }
  831. /* C R E A T E I N T E R F A C E O B J E C T */
  832. /*------------------------------------------------------------------------------
  833. ------------------------------------------------------------------------------*/
  834. HRESULT CCandIndexProperty::CreateInterfaceObject( REFIID riid, void **ppvObj )
  835. {
  836. CCandUICandIndex *pObject;
  837. HRESULT hr;
  838. pObject = new CCandUICandIndex( this );
  839. if (pObject == NULL) {
  840. return E_OUTOFMEMORY;
  841. }
  842. hr = pObject->QueryInterface( riid, ppvObj );
  843. pObject->Release();
  844. return hr;
  845. }
  846. /*============================================================================*/
  847. /* */
  848. /* C P O P U P C O M M E N T W I N D O W P R O P E R T Y */
  849. /* */
  850. /*============================================================================*/
  851. /* C P O P U P C O M M E N T W I N D O W P R O P E R T Y */
  852. /*------------------------------------------------------------------------------
  853. Constructor of CPopupCommentWindowProperty
  854. ------------------------------------------------------------------------------*/
  855. CPopupCommentWindowProperty::CPopupCommentWindowProperty( CCandUIPropertyMgr *pPropMgr ) : CCandUIObjectProperty( pPropMgr )
  856. {
  857. LOGFONTW lf;
  858. GetNonClientLogFont( NCFONT_MESSAGE, &lf );
  859. m_flags.fAllowEnable = FALSE;
  860. m_flags.fAllowDisable = FALSE;
  861. m_flags.fAllowIsEnabled = FALSE;
  862. m_flags.fAllowShow = FALSE;
  863. m_flags.fAllowHide = FALSE;
  864. m_flags.fAllowIsVisible = FALSE;
  865. m_flags.fAllowSetPosition = FALSE;
  866. m_flags.fAllowGetPosition = TRUE;
  867. m_flags.fAllowSetSize = FALSE;
  868. m_flags.fAllowGetSize = TRUE;
  869. m_flags.fAllowSetFont = FALSE;
  870. m_flags.fAllowGetFont = FALSE;
  871. m_flags.fAllowSetText = FALSE;
  872. m_flags.fAllowGetText = FALSE;
  873. m_flags.fAllowSetToolTip = FALSE;
  874. m_flags.fAllowGetToolTip = FALSE;
  875. m_propEnabled.Set( TRUE );
  876. m_propVisible.Set( TRUE );
  877. m_propFont.Set( &lf );
  878. m_propFont.SetOrientation( PROPFONTORT_DONTCARE );
  879. m_propText.Set( NULL );
  880. m_propToolTip.Set( NULL );
  881. m_propDelayTime.Set( 500 /* 500ms */ );
  882. m_propAutoMoveEnabled.Set( TRUE );
  883. m_hWnd = NULL;
  884. //
  885. CCandUIObjectEventSink::InitEventSink( pPropMgr->GetCandidateUI()->GetUIObjectMgr() );
  886. }
  887. /* ~ C P O P U P C O M M E N T W I N D O W P R O P E R T Y */
  888. /*------------------------------------------------------------------------------
  889. Destructor of CPopupCommentWindowProperty
  890. ------------------------------------------------------------------------------*/
  891. CPopupCommentWindowProperty::~CPopupCommentWindowProperty( void )
  892. {
  893. CCandUIObjectEventSink::DoneEventSink();
  894. }
  895. /* G E T W I N D O W */
  896. /*------------------------------------------------------------------------------
  897. ------------------------------------------------------------------------------*/
  898. HRESULT CPopupCommentWindowProperty::GetWindow( HWND *phWnd )
  899. {
  900. if (phWnd == NULL) {
  901. return E_INVALIDARG;
  902. }
  903. *phWnd = m_hWnd;
  904. return (*phWnd != NULL) ? S_OK : E_FAIL;
  905. }
  906. /* S E T D E L A Y T I M E */
  907. /*------------------------------------------------------------------------------
  908. ------------------------------------------------------------------------------*/
  909. HRESULT CPopupCommentWindowProperty::SetDelayTime( LONG lTime )
  910. {
  911. HRESULT hr;
  912. if (lTime == -1) {
  913. lTime = 500; /* 500ms */
  914. }
  915. hr = m_propDelayTime.Set( lTime );
  916. if (hr == S_OK) {
  917. NotifyUpdate( CANDUIPROPEV_UPDATEPOPUPDELAY );
  918. }
  919. return (SUCCEEDED(hr) ? S_OK : hr);
  920. }
  921. /* G E T D E L A Y T I M E */
  922. /*------------------------------------------------------------------------------
  923. ------------------------------------------------------------------------------*/
  924. HRESULT CPopupCommentWindowProperty::GetDelayTime( LONG *plTime )
  925. {
  926. return m_propDelayTime.Get( plTime );
  927. }
  928. /* E N A B L E A U T O M O V E */
  929. /*------------------------------------------------------------------------------
  930. ------------------------------------------------------------------------------*/
  931. HRESULT CPopupCommentWindowProperty::EnableAutoMove( BOOL fEnable )
  932. {
  933. return m_propAutoMoveEnabled.Set( fEnable );
  934. }
  935. /* I S A U T O M O V E E N A B L E D */
  936. /*------------------------------------------------------------------------------
  937. ------------------------------------------------------------------------------*/
  938. HRESULT CPopupCommentWindowProperty::IsAutoMoveEnabled( BOOL *pfEnabled )
  939. {
  940. return m_propAutoMoveEnabled.Get( pfEnabled );
  941. }
  942. /* G E T D E L A Y T I M E */
  943. /*------------------------------------------------------------------------------
  944. ------------------------------------------------------------------------------*/
  945. LONG CPopupCommentWindowProperty::GetDelayTime( void )
  946. {
  947. return m_propDelayTime.Get();
  948. }
  949. /* I S A U T O M O V E E N A B L E D */
  950. /*------------------------------------------------------------------------------
  951. ------------------------------------------------------------------------------*/
  952. BOOL CPopupCommentWindowProperty::IsAutoMoveEnabled( void )
  953. {
  954. return m_propAutoMoveEnabled.Get();
  955. }
  956. /* O N O B J E C T E V E N T */
  957. /*------------------------------------------------------------------------------
  958. ------------------------------------------------------------------------------*/
  959. void CPopupCommentWindowProperty::OnObjectEvent( CANDUIOBJECT obj, CANDUIOBJECTEVENT event )
  960. {
  961. if (obj != CANDUIOBJ_POPUPCOMMENTWINDOW) {
  962. return;
  963. }
  964. switch (event) {
  965. case CANDUIOBJEV_CREATED: {
  966. if (GetUIObjectMgr()->GetPopupCommentWindowObj()) {
  967. RECT rc;
  968. m_hWnd = GetUIObjectMgr()->GetPopupCommentWindowObj()->GetWnd();
  969. GetWindowRect( m_hWnd, &rc );
  970. m_propPos.Set( rc.left, rc.top );
  971. m_propSize.Set( rc.right - rc.left, rc.bottom - rc.top );
  972. }
  973. else {
  974. m_hWnd = NULL;
  975. m_propPos.Set( 0, 0 );
  976. m_propSize.Set( 0, 0 );
  977. }
  978. break;
  979. }
  980. case CANDUIOBJEV_DESTROYED: {
  981. m_hWnd = NULL;
  982. m_propPos.Set( 0, 0 );
  983. m_propSize.Set( 0, 0 );
  984. break;
  985. }
  986. case CANDUIOBJEV_UPDATED: {
  987. RECT rc;
  988. GetWindowRect( m_hWnd, &rc );
  989. m_propPos.Set( rc.left, rc.top );
  990. m_propSize.Set( rc.right - rc.left, rc.bottom - rc.top );
  991. break;
  992. }
  993. }
  994. }
  995. /* C R E A T E I N T E R F A C E O B J E C T */
  996. /*------------------------------------------------------------------------------
  997. ------------------------------------------------------------------------------*/
  998. HRESULT CPopupCommentWindowProperty::CreateInterfaceObject( REFIID riid, void **ppvObj )
  999. {
  1000. CCandUIPopupCommentWindow *pObject;
  1001. HRESULT hr;
  1002. pObject = new CCandUIPopupCommentWindow( this );
  1003. if (pObject == NULL) {
  1004. return E_OUTOFMEMORY;
  1005. }
  1006. hr = pObject->QueryInterface( riid, ppvObj );
  1007. pObject->Release();
  1008. return hr;
  1009. }
  1010. /*============================================================================*/
  1011. /* */
  1012. /* C P O P U P C O M M E N T T I T L E P R O P E R T Y */
  1013. /* */
  1014. /*============================================================================*/
  1015. /* C P O P U P C O M M E N T T I T L E P R O P E R T Y */
  1016. /*------------------------------------------------------------------------------
  1017. Constructor of CPopupCommentTitleProperty
  1018. ------------------------------------------------------------------------------*/
  1019. CPopupCommentTitleProperty::CPopupCommentTitleProperty( CCandUIPropertyMgr *pPropMgr ) : CCandUIObjectProperty( pPropMgr )
  1020. {
  1021. LOGFONTW lf;
  1022. GetNonClientLogFont( NCFONT_MESSAGE, &lf );
  1023. m_flags.fAllowEnable = FALSE;
  1024. m_flags.fAllowDisable = FALSE;
  1025. m_flags.fAllowIsEnabled = FALSE;
  1026. m_flags.fAllowShow = FALSE;
  1027. m_flags.fAllowHide = FALSE;
  1028. m_flags.fAllowIsVisible = FALSE;
  1029. m_flags.fAllowSetPosition = FALSE;
  1030. m_flags.fAllowGetPosition = FALSE;
  1031. m_flags.fAllowSetSize = FALSE;
  1032. m_flags.fAllowGetSize = FALSE;
  1033. m_flags.fAllowSetFont = TRUE;
  1034. m_flags.fAllowGetFont = TRUE;
  1035. m_flags.fAllowSetText = FALSE;
  1036. m_flags.fAllowGetText = FALSE;
  1037. m_flags.fAllowSetToolTip = FALSE;
  1038. m_flags.fAllowGetToolTip = FALSE;
  1039. m_propEnabled.Set( TRUE );
  1040. m_propVisible.Set( TRUE );
  1041. m_propFont.Set( &lf );
  1042. m_propFont.SetOrientation( PROPFONTORT_DONTCARE );
  1043. m_propText.Set( NULL );
  1044. m_propToolTip.Set( NULL );
  1045. }
  1046. /* ~ C P O P U P C O M M E N T T I T L E P R O P E R T Y */
  1047. /*------------------------------------------------------------------------------
  1048. Destructor of CPopupCommentTitleProperty
  1049. ------------------------------------------------------------------------------*/
  1050. CPopupCommentTitleProperty::~CPopupCommentTitleProperty( void )
  1051. {
  1052. }
  1053. /* C R E A T E I N T E R F A C E O B J E C T */
  1054. /*------------------------------------------------------------------------------
  1055. ------------------------------------------------------------------------------*/
  1056. HRESULT CPopupCommentTitleProperty::CreateInterfaceObject( REFIID riid, void **ppvObj )
  1057. {
  1058. CCandUIPopupCommentTitle *pObject;
  1059. HRESULT hr;
  1060. pObject = new CCandUIPopupCommentTitle( this );
  1061. if (pObject == NULL) {
  1062. return E_OUTOFMEMORY;
  1063. }
  1064. hr = pObject->QueryInterface( riid, ppvObj );
  1065. pObject->Release();
  1066. return hr;
  1067. }
  1068. /*============================================================================*/
  1069. /* */
  1070. /* C P O P U P C O M M E N T T E X T P R O P E R T Y */
  1071. /* */
  1072. /*============================================================================*/
  1073. /* C P O P U P C O M M E N T T E X T P R O P E R T Y */
  1074. /*------------------------------------------------------------------------------
  1075. Constructor of CPopupCommentTextProperty
  1076. ------------------------------------------------------------------------------*/
  1077. CPopupCommentTextProperty::CPopupCommentTextProperty( CCandUIPropertyMgr *pPropMgr ) : CCandUIObjectProperty( pPropMgr )
  1078. {
  1079. LOGFONTW lf;
  1080. GetNonClientLogFont( NCFONT_MENU, &lf );
  1081. m_flags.fAllowEnable = FALSE;
  1082. m_flags.fAllowDisable = FALSE;
  1083. m_flags.fAllowIsEnabled = FALSE;
  1084. m_flags.fAllowShow = FALSE;
  1085. m_flags.fAllowHide = FALSE;
  1086. m_flags.fAllowIsVisible = FALSE;
  1087. m_flags.fAllowSetPosition = FALSE;
  1088. m_flags.fAllowGetPosition = FALSE;
  1089. m_flags.fAllowSetSize = FALSE;
  1090. m_flags.fAllowGetSize = FALSE;
  1091. m_flags.fAllowSetFont = TRUE;
  1092. m_flags.fAllowGetFont = TRUE;
  1093. m_flags.fAllowSetText = FALSE;
  1094. m_flags.fAllowGetText = FALSE;
  1095. m_flags.fAllowSetToolTip = FALSE;
  1096. m_flags.fAllowGetToolTip = FALSE;
  1097. m_propEnabled.Set( TRUE );
  1098. m_propVisible.Set( TRUE );
  1099. m_propFont.Set( &lf );
  1100. m_propFont.SetOrientation( PROPFONTORT_DONTCARE );
  1101. m_propText.Set( NULL );
  1102. m_propToolTip.Set( NULL );
  1103. }
  1104. /* ~ C P O P U P C O M M E N T T E X T P R O P E R T Y */
  1105. /*------------------------------------------------------------------------------
  1106. Destructor of CPopupCommentTextProperty
  1107. ------------------------------------------------------------------------------*/
  1108. CPopupCommentTextProperty::~CPopupCommentTextProperty( void )
  1109. {
  1110. }
  1111. /* C R E A T E I N T E R F A C E O B J E C T */
  1112. /*------------------------------------------------------------------------------
  1113. ------------------------------------------------------------------------------*/
  1114. HRESULT CPopupCommentTextProperty::CreateInterfaceObject( REFIID riid, void **ppvObj )
  1115. {
  1116. CCandUIPopupCommentText *pObject;
  1117. HRESULT hr;
  1118. pObject = new CCandUIPopupCommentText( this );
  1119. if (pObject == NULL) {
  1120. return E_OUTOFMEMORY;
  1121. }
  1122. hr = pObject->QueryInterface( riid, ppvObj );
  1123. pObject->Release();
  1124. return hr;
  1125. }
  1126. /*============================================================================*/
  1127. /* */
  1128. /* C W I N D O W C A P T I O N P R O P E R T Y */
  1129. /* */
  1130. /*============================================================================*/
  1131. /* C W I N D O W C A P T I O N P R O P E R T Y */
  1132. /*------------------------------------------------------------------------------
  1133. Constructor of CWindowCaptionProperty
  1134. ------------------------------------------------------------------------------*/
  1135. CWindowCaptionProperty::CWindowCaptionProperty( CCandUIPropertyMgr *pPropMgr ) : CCandUIObjectProperty( pPropMgr )
  1136. {
  1137. LOGFONTW lf;
  1138. GetNonClientLogFont( NCFONT_SMCAPTION, &lf );
  1139. m_flags.fAllowEnable = FALSE;
  1140. m_flags.fAllowDisable = FALSE;
  1141. m_flags.fAllowIsEnabled = FALSE;
  1142. m_flags.fAllowShow = TRUE;
  1143. m_flags.fAllowHide = TRUE;
  1144. m_flags.fAllowIsVisible = TRUE;
  1145. m_flags.fAllowSetPosition = FALSE;
  1146. m_flags.fAllowGetPosition = TRUE;
  1147. m_flags.fAllowSetSize = FALSE;
  1148. m_flags.fAllowGetSize = TRUE;
  1149. m_flags.fAllowSetFont = TRUE;
  1150. m_flags.fAllowGetFont = TRUE;
  1151. m_flags.fAllowSetText = TRUE;
  1152. m_flags.fAllowGetText = TRUE;
  1153. m_flags.fAllowSetToolTip = FALSE;
  1154. m_flags.fAllowGetToolTip = FALSE;
  1155. m_propEnabled.Set( TRUE );
  1156. m_propVisible.Set( FALSE );
  1157. m_propPos.Set( 0, 0 );
  1158. m_propSize.Set( 0, 0 );
  1159. m_propFont.Set( &lf );
  1160. m_propFont.SetOrientation( PROPFONTORT_DONTCARE );
  1161. m_propText.Set( NULL );
  1162. m_propToolTip.Set( NULL );
  1163. CCandUIObjectEventSink::InitEventSink( pPropMgr->GetCandidateUI()->GetUIObjectMgr() );
  1164. }
  1165. /* ~ C W I N D O W C A P T I O N P R O P E R T Y */
  1166. /*------------------------------------------------------------------------------
  1167. Destructor of CWindowCaptionProperty
  1168. ------------------------------------------------------------------------------*/
  1169. CWindowCaptionProperty::~CWindowCaptionProperty( void )
  1170. {
  1171. CCandUIObjectEventSink::DoneEventSink();
  1172. }
  1173. /* O N O B J E C T E V E N T */
  1174. /*------------------------------------------------------------------------------
  1175. ------------------------------------------------------------------------------*/
  1176. void CWindowCaptionProperty::OnObjectEvent( CANDUIOBJECT obj, CANDUIOBJECTEVENT event )
  1177. {
  1178. if (obj != CANDUIOBJ_CANDCAPTION) {
  1179. return;
  1180. }
  1181. switch (event) {
  1182. case CANDUIOBJEV_CREATED: {
  1183. break;
  1184. }
  1185. case CANDUIOBJEV_DESTROYED: {
  1186. m_propPos.Set( 0, 0 );
  1187. m_propSize.Set( 0, 0 );
  1188. break;
  1189. }
  1190. case CANDUIOBJEV_UPDATED: {
  1191. CUIFWndCaption *pUIObject = GetUIObjectMgr()->GetCaptionObj();
  1192. if ((pUIObject != NULL) && pUIObject->IsVisible()) {
  1193. RECT rc;
  1194. pUIObject->GetRect( &rc );
  1195. m_propPos.Set( rc.left, rc.top );
  1196. m_propSize.Set( rc.right - rc.left, rc.bottom - rc.top );
  1197. }
  1198. else {
  1199. m_propPos.Set( 0, 0 );
  1200. m_propSize.Set( 0, 0 );
  1201. }
  1202. break;
  1203. }
  1204. }
  1205. }
  1206. /* C R E A T E I N T E R F A C E O B J E C T */
  1207. /*------------------------------------------------------------------------------
  1208. ------------------------------------------------------------------------------*/
  1209. HRESULT CWindowCaptionProperty::CreateInterfaceObject( REFIID riid, void **ppvObj )
  1210. {
  1211. CCandUICaption *pObject;
  1212. HRESULT hr;
  1213. pObject = new CCandUICaption( this );
  1214. if (pObject == NULL) {
  1215. return E_OUTOFMEMORY;
  1216. }
  1217. hr = pObject->QueryInterface( riid, ppvObj );
  1218. pObject->Release();
  1219. return hr;
  1220. }
  1221. /*============================================================================*/
  1222. /* */
  1223. /* C M E N U B U T T O N P R O P E R T Y */
  1224. /* */
  1225. /*============================================================================*/
  1226. /* C M E N U B U T T O N P R O P E R T Y */
  1227. /*------------------------------------------------------------------------------
  1228. Constructor of CMenuButtonProperty
  1229. ------------------------------------------------------------------------------*/
  1230. CMenuButtonProperty::CMenuButtonProperty( CCandUIPropertyMgr *pPropMgr ) : CCandUIObjectProperty( pPropMgr )
  1231. {
  1232. m_flags.fAllowEnable = TRUE;
  1233. m_flags.fAllowDisable = TRUE;
  1234. m_flags.fAllowIsEnabled = TRUE;
  1235. m_flags.fAllowShow = TRUE;
  1236. m_flags.fAllowHide = TRUE;
  1237. m_flags.fAllowIsVisible = TRUE;
  1238. m_flags.fAllowSetPosition = FALSE;
  1239. m_flags.fAllowGetPosition = TRUE;
  1240. m_flags.fAllowSetSize = FALSE;
  1241. m_flags.fAllowGetSize = TRUE;
  1242. m_flags.fAllowSetFont = FALSE;
  1243. m_flags.fAllowGetFont = FALSE;
  1244. m_flags.fAllowSetText = FALSE;
  1245. m_flags.fAllowGetText = FALSE;
  1246. m_flags.fAllowSetToolTip = TRUE;
  1247. m_flags.fAllowGetToolTip = TRUE;
  1248. m_propEnabled.Set( FALSE );
  1249. m_propVisible.Set( FALSE );
  1250. m_propFont.Set( NULL );
  1251. m_propText.Set( NULL );
  1252. m_propToolTip.Set( NULL );
  1253. m_pSink = NULL;
  1254. CCandUIObjectEventSink::InitEventSink( pPropMgr->GetCandidateUI()->GetUIObjectMgr() );
  1255. }
  1256. /* ~ C M E N U B U T T O N P R O P E R T Y */
  1257. /*------------------------------------------------------------------------------
  1258. Destructor of CMenuButtonProperty
  1259. ------------------------------------------------------------------------------*/
  1260. CMenuButtonProperty::~CMenuButtonProperty( void )
  1261. {
  1262. ReleaseEventSink();
  1263. CCandUIObjectEventSink::DoneEventSink();
  1264. }
  1265. /* O N O B J E C T E V E N T */
  1266. /*------------------------------------------------------------------------------
  1267. ------------------------------------------------------------------------------*/
  1268. void CMenuButtonProperty::OnObjectEvent( CANDUIOBJECT obj, CANDUIOBJECTEVENT event )
  1269. {
  1270. if (obj != CANDUIOBJ_MENUBUTTON) {
  1271. return;
  1272. }
  1273. switch (event) {
  1274. case CANDUIOBJEV_CREATED: {
  1275. break;
  1276. }
  1277. case CANDUIOBJEV_DESTROYED: {
  1278. m_propPos.Set( 0, 0 );
  1279. m_propSize.Set( 0, 0 );
  1280. break;
  1281. }
  1282. case CANDUIOBJEV_UPDATED: {
  1283. CUIFButton *pUIObject = GetUIObjectMgr()->GetMenuButtonObj();
  1284. if ((pUIObject != NULL) && pUIObject->IsVisible()) {
  1285. RECT rc;
  1286. pUIObject->GetRect( &rc );
  1287. m_propPos.Set( rc.left, rc.top );
  1288. m_propSize.Set( rc.right - rc.left, rc.bottom - rc.top );
  1289. }
  1290. else {
  1291. m_propPos.Set( 0, 0 );
  1292. m_propSize.Set( 0, 0 );
  1293. }
  1294. break;
  1295. }
  1296. }
  1297. }
  1298. /* C R E A T E I N T E R F A C E O B J E C T */
  1299. /*------------------------------------------------------------------------------
  1300. ------------------------------------------------------------------------------*/
  1301. HRESULT CMenuButtonProperty::CreateInterfaceObject( REFIID riid, void **ppvObj )
  1302. {
  1303. CCandUIMenuButton *pObject;
  1304. HRESULT hr;
  1305. pObject = new CCandUIMenuButton( this );
  1306. if (pObject == NULL) {
  1307. return E_OUTOFMEMORY;
  1308. }
  1309. hr = pObject->QueryInterface( riid, ppvObj );
  1310. pObject->Release();
  1311. return hr;
  1312. }
  1313. /*============================================================================*/
  1314. /* */
  1315. /* C E X T R A C A N D I D A T E P R O P E R T Y */
  1316. /* */
  1317. /*============================================================================*/
  1318. /* C E X T R A C A N D I D A T E P R O P E R T Y */
  1319. /*------------------------------------------------------------------------------
  1320. Constructor of CExtraCandidateProperty
  1321. ------------------------------------------------------------------------------*/
  1322. CExtraCandidateProperty::CExtraCandidateProperty( CCandUIPropertyMgr *pPropMgr ) : CCandUIObjectProperty( pPropMgr )
  1323. {
  1324. m_flags.fAllowEnable = FALSE;
  1325. m_flags.fAllowDisable = FALSE;
  1326. m_flags.fAllowIsEnabled = FALSE;
  1327. m_flags.fAllowShow = FALSE;
  1328. m_flags.fAllowHide = FALSE;
  1329. m_flags.fAllowIsVisible = FALSE;
  1330. m_flags.fAllowSetPosition = FALSE;
  1331. m_flags.fAllowGetPosition = TRUE;
  1332. m_flags.fAllowSetSize = FALSE;
  1333. m_flags.fAllowGetSize = TRUE;
  1334. m_flags.fAllowSetFont = FALSE;
  1335. m_flags.fAllowGetFont = FALSE;
  1336. m_flags.fAllowSetText = FALSE;
  1337. m_flags.fAllowGetText = FALSE;
  1338. m_flags.fAllowSetToolTip = FALSE;
  1339. m_flags.fAllowGetToolTip = FALSE;
  1340. m_propEnabled.Set( TRUE );
  1341. m_propVisible.Set( TRUE );
  1342. m_propFont.Set( NULL );
  1343. m_propText.Set( NULL );
  1344. m_propToolTip.Set( NULL );
  1345. CCandUIObjectEventSink::InitEventSink( pPropMgr->GetCandidateUI()->GetUIObjectMgr() );
  1346. }
  1347. /* ~ C E X T R A C A N D I D A T E P R O P E R T Y */
  1348. /*------------------------------------------------------------------------------
  1349. Destructor of CExtraCandidateProperty
  1350. ------------------------------------------------------------------------------*/
  1351. CExtraCandidateProperty::~CExtraCandidateProperty( void )
  1352. {
  1353. CCandUIObjectEventSink::DoneEventSink();
  1354. }
  1355. /* O N O B J E C T E V E N T */
  1356. /*------------------------------------------------------------------------------
  1357. ------------------------------------------------------------------------------*/
  1358. void CExtraCandidateProperty::OnObjectEvent( CANDUIOBJECT obj, CANDUIOBJECTEVENT event )
  1359. {
  1360. if (obj != CANDUIOBJ_EXTRACANDIDATE) {
  1361. return;
  1362. }
  1363. switch (event) {
  1364. case CANDUIOBJEV_CREATED: {
  1365. break;
  1366. }
  1367. case CANDUIOBJEV_DESTROYED: {
  1368. m_propPos.Set( 0, 0 );
  1369. m_propSize.Set( 0, 0 );
  1370. break;
  1371. }
  1372. case CANDUIOBJEV_UPDATED: {
  1373. CUIFCandListBase *pUIObject = GetUIObjectMgr()->GetExtraCandidateObj();
  1374. if ((pUIObject != NULL) && pUIObject->IsVisible()) {
  1375. RECT rc;
  1376. pUIObject->GetRect( &rc );
  1377. m_propPos.Set( rc.left, rc.top );
  1378. m_propSize.Set( rc.right - rc.left, rc.bottom - rc.top );
  1379. }
  1380. else {
  1381. m_propPos.Set( 0, 0 );
  1382. m_propSize.Set( 0, 0 );
  1383. }
  1384. break;
  1385. }
  1386. }
  1387. }
  1388. /* C R E A T E I N T E R F A C E O B J E C T */
  1389. /*------------------------------------------------------------------------------
  1390. ------------------------------------------------------------------------------*/
  1391. HRESULT CExtraCandidateProperty::CreateInterfaceObject( REFIID riid, void **ppvObj )
  1392. {
  1393. CCandUIExtraCandidate *pObject;
  1394. HRESULT hr;
  1395. pObject = new CCandUIExtraCandidate( this );
  1396. if (pObject == NULL) {
  1397. return E_OUTOFMEMORY;
  1398. }
  1399. hr = pObject->QueryInterface( riid, ppvObj );
  1400. pObject->Release();
  1401. return hr;
  1402. }
  1403. /*============================================================================*/
  1404. /* */
  1405. /* C C A N D R A W D A T A P R O P E R T Y */
  1406. /* */
  1407. /*============================================================================*/
  1408. /* C C A N D R A W D A T A P R O P E R T Y */
  1409. /*------------------------------------------------------------------------------
  1410. Constructor of CCandRawDataProperty
  1411. ------------------------------------------------------------------------------*/
  1412. CCandRawDataProperty::CCandRawDataProperty( CCandUIPropertyMgr *pPropMgr ) : CCandUIObjectProperty( pPropMgr )
  1413. {
  1414. m_flags.fAllowEnable = FALSE;
  1415. m_flags.fAllowDisable = FALSE;
  1416. m_flags.fAllowIsEnabled = FALSE;
  1417. m_flags.fAllowShow = FALSE;
  1418. m_flags.fAllowHide = FALSE;
  1419. m_flags.fAllowIsVisible = FALSE;
  1420. m_flags.fAllowSetPosition = FALSE;
  1421. m_flags.fAllowGetPosition = TRUE;
  1422. m_flags.fAllowSetSize = FALSE;
  1423. m_flags.fAllowGetSize = TRUE;
  1424. m_flags.fAllowSetFont = FALSE;
  1425. m_flags.fAllowGetFont = FALSE;
  1426. m_flags.fAllowSetText = FALSE;
  1427. m_flags.fAllowGetText = FALSE;
  1428. m_flags.fAllowSetToolTip = FALSE;
  1429. m_flags.fAllowGetToolTip = FALSE;
  1430. m_propEnabled.Set( TRUE );
  1431. m_propVisible.Set( TRUE );
  1432. m_propFont.Set( NULL );
  1433. m_propText.Set( NULL );
  1434. m_propToolTip.Set( NULL );
  1435. CCandUIObjectEventSink::InitEventSink( pPropMgr->GetCandidateUI()->GetUIObjectMgr() );
  1436. }
  1437. /* ~ C C A N D R A W D A T A P R O P E R T Y */
  1438. /*------------------------------------------------------------------------------
  1439. Destructor of CCandRawDataProperty
  1440. ------------------------------------------------------------------------------*/
  1441. CCandRawDataProperty::~CCandRawDataProperty( void )
  1442. {
  1443. CCandUIObjectEventSink::DoneEventSink();
  1444. }
  1445. /* O N O B J E C T E V E N T */
  1446. /*------------------------------------------------------------------------------
  1447. ------------------------------------------------------------------------------*/
  1448. void CCandRawDataProperty::OnObjectEvent( CANDUIOBJECT obj, CANDUIOBJECTEVENT event )
  1449. {
  1450. if (obj != CANDUIOBJ_CANDRAWDATA) {
  1451. return;
  1452. }
  1453. switch (event) {
  1454. case CANDUIOBJEV_CREATED: {
  1455. break;
  1456. }
  1457. case CANDUIOBJEV_DESTROYED: {
  1458. m_propPos.Set( 0, 0 );
  1459. m_propSize.Set( 0, 0 );
  1460. break;
  1461. }
  1462. case CANDUIOBJEV_UPDATED: {
  1463. CUIFCandRawData *pUIObject = GetUIObjectMgr()->GetCandRawDataObj();
  1464. if ((pUIObject != NULL) && pUIObject->IsVisible()) {
  1465. RECT rc;
  1466. pUIObject->GetRect( &rc );
  1467. m_propPos.Set( rc.left, rc.top );
  1468. m_propSize.Set( rc.right - rc.left, rc.bottom - rc.top );
  1469. }
  1470. else {
  1471. m_propPos.Set( 0, 0 );
  1472. m_propSize.Set( 0, 0 );
  1473. }
  1474. break;
  1475. }
  1476. }
  1477. }
  1478. /* C R E A T E I N T E R F A C E O B J E C T */
  1479. /*------------------------------------------------------------------------------
  1480. ------------------------------------------------------------------------------*/
  1481. HRESULT CCandRawDataProperty::CreateInterfaceObject( REFIID riid, void **ppvObj )
  1482. {
  1483. CCandUIRawData *pObject;
  1484. HRESULT hr;
  1485. pObject = new CCandUIRawData( this );
  1486. if (pObject == NULL) {
  1487. return E_OUTOFMEMORY;
  1488. }
  1489. hr = pObject->QueryInterface( riid, ppvObj );
  1490. pObject->Release();
  1491. return hr;
  1492. }
  1493. /*============================================================================*/
  1494. /* */
  1495. /* C T O O L T I P P R O P E R T Y */
  1496. /* */
  1497. /*============================================================================*/
  1498. /* C T O O L T I P P R O P E R T Y */
  1499. /*------------------------------------------------------------------------------
  1500. Constructror of CToolTipProperty
  1501. ------------------------------------------------------------------------------*/
  1502. CToolTipProperty::CToolTipProperty( CCandUIPropertyMgr *pPropMgr ) : CCandUIObjectProperty( pPropMgr )
  1503. {
  1504. LOGFONTW lf;
  1505. GetNonClientLogFont( NCFONT_STATUS, &lf );
  1506. m_flags.fAllowEnable = TRUE;
  1507. m_flags.fAllowDisable = TRUE;
  1508. m_flags.fAllowIsEnabled = TRUE;
  1509. m_flags.fAllowShow = FALSE;
  1510. m_flags.fAllowHide = FALSE;
  1511. m_flags.fAllowIsVisible = FALSE;
  1512. m_flags.fAllowSetPosition = FALSE;
  1513. m_flags.fAllowGetPosition = FALSE;
  1514. m_flags.fAllowSetSize = FALSE;
  1515. m_flags.fAllowGetSize = FALSE;
  1516. m_flags.fAllowSetFont = TRUE;
  1517. m_flags.fAllowGetFont = TRUE;
  1518. m_flags.fAllowSetText = FALSE;
  1519. m_flags.fAllowGetText = FALSE;
  1520. m_flags.fAllowSetToolTip = FALSE;
  1521. m_flags.fAllowGetToolTip = FALSE;
  1522. m_propEnabled.Set( TRUE );
  1523. m_propVisible.Set( FALSE );
  1524. m_propFont.Set( &lf );
  1525. m_propFont.SetOrientation( PROPFONTORT_DONTCARE );
  1526. m_propText.Set( NULL );
  1527. m_propToolTip.Set( NULL );
  1528. }
  1529. /* ~ C T O O L T I P P R O P E R T Y */
  1530. /*------------------------------------------------------------------------------
  1531. Destructor of CToolTipProperty
  1532. ------------------------------------------------------------------------------*/
  1533. CToolTipProperty::~CToolTipProperty( void )
  1534. {
  1535. }
  1536. /* C R E A T E I N T E R F A C E O B J E C T */
  1537. /*------------------------------------------------------------------------------
  1538. ------------------------------------------------------------------------------*/
  1539. HRESULT CToolTipProperty::CreateInterfaceObject( REFIID riid, void **ppvObj )
  1540. {
  1541. CCandUIToolTip *pObject;
  1542. HRESULT hr;
  1543. pObject = new CCandUIToolTip( this );
  1544. if (pObject == NULL) {
  1545. return E_OUTOFMEMORY;
  1546. }
  1547. hr = pObject->QueryInterface( riid, ppvObj );
  1548. pObject->Release();
  1549. return hr;
  1550. }
  1551. /*============================================================================*/
  1552. /* */
  1553. /* C C A N D T I P W I N D O W P R O P E R T Y */
  1554. /* */
  1555. /*============================================================================*/
  1556. /* C C A N D T I P W I N D O W P R O P E R T Y */
  1557. /*------------------------------------------------------------------------------
  1558. Constructor of CCandTipWindowProperty
  1559. ------------------------------------------------------------------------------*/
  1560. CCandTipWindowProperty::CCandTipWindowProperty( CCandUIPropertyMgr *pPropMgr ) : CCandUIObjectProperty( pPropMgr )
  1561. {
  1562. LOGFONTW lf;
  1563. GetNonClientLogFont( NCFONT_STATUS, &lf );
  1564. m_flags.fAllowEnable = FALSE;
  1565. m_flags.fAllowDisable = FALSE;
  1566. m_flags.fAllowIsEnabled = FALSE;
  1567. m_flags.fAllowShow = TRUE;
  1568. m_flags.fAllowHide = TRUE;
  1569. m_flags.fAllowIsVisible = TRUE;
  1570. m_flags.fAllowSetPosition = FALSE;
  1571. m_flags.fAllowGetPosition = TRUE;
  1572. m_flags.fAllowSetSize = FALSE;
  1573. m_flags.fAllowGetSize = TRUE;
  1574. m_flags.fAllowSetFont = FALSE;
  1575. m_flags.fAllowGetFont = FALSE;
  1576. m_flags.fAllowSetText = FALSE;
  1577. m_flags.fAllowGetText = FALSE;
  1578. m_flags.fAllowSetToolTip = FALSE;
  1579. m_flags.fAllowGetToolTip = FALSE;
  1580. m_propEnabled.Set( TRUE );
  1581. m_propVisible.Set( TRUE );
  1582. m_propFont.Set( &lf );
  1583. m_propFont.SetOrientation( PROPFONTORT_DONTCARE );
  1584. m_propText.Set( NULL );
  1585. m_propToolTip.Set( NULL );
  1586. m_hWnd = NULL;
  1587. //
  1588. CCandUIObjectEventSink::InitEventSink( pPropMgr->GetCandidateUI()->GetUIObjectMgr() );
  1589. }
  1590. /* ~ C C A N D T I P W I N D O W P R O P E R T Y */
  1591. /*------------------------------------------------------------------------------
  1592. Destructor of CCandTipWindowProperty
  1593. ------------------------------------------------------------------------------*/
  1594. CCandTipWindowProperty::~CCandTipWindowProperty( void )
  1595. {
  1596. CCandUIObjectEventSink::DoneEventSink();
  1597. }
  1598. /* G E T W I N D O W */
  1599. /*------------------------------------------------------------------------------
  1600. ------------------------------------------------------------------------------*/
  1601. HRESULT CCandTipWindowProperty::GetWindow( HWND *phWnd )
  1602. {
  1603. if (phWnd == NULL) {
  1604. return E_INVALIDARG;
  1605. }
  1606. *phWnd = m_hWnd;
  1607. return (*phWnd != NULL) ? S_OK : E_FAIL;
  1608. }
  1609. /* O N O B J E C T E V E N T */
  1610. /*------------------------------------------------------------------------------
  1611. ------------------------------------------------------------------------------*/
  1612. void CCandTipWindowProperty::OnObjectEvent( CANDUIOBJECT obj, CANDUIOBJECTEVENT event )
  1613. {
  1614. if (obj != CANDUIOBJ_CANDTIPWINDOW) {
  1615. return;
  1616. }
  1617. switch (event) {
  1618. case CANDUIOBJEV_CREATED: {
  1619. if (GetUIObjectMgr()->GetCandTipWindowObj()) {
  1620. RECT rc;
  1621. m_hWnd = GetUIObjectMgr()->GetCandTipWindowObj()->GetWnd();
  1622. GetWindowRect( m_hWnd, &rc );
  1623. m_propPos.Set( rc.left, rc.top );
  1624. m_propSize.Set( rc.right - rc.left, rc.bottom - rc.top );
  1625. }
  1626. else {
  1627. m_hWnd = NULL;
  1628. m_propPos.Set( 0, 0 );
  1629. m_propSize.Set( 0, 0 );
  1630. }
  1631. break;
  1632. }
  1633. case CANDUIOBJEV_DESTROYED: {
  1634. m_hWnd = NULL;
  1635. m_propPos.Set( 0, 0 );
  1636. m_propSize.Set( 0, 0 );
  1637. break;
  1638. }
  1639. case CANDUIOBJEV_UPDATED: {
  1640. RECT rc;
  1641. GetWindowRect( m_hWnd, &rc );
  1642. m_propPos.Set( rc.left, rc.top );
  1643. m_propSize.Set( rc.right - rc.left, rc.bottom - rc.top );
  1644. break;
  1645. }
  1646. }
  1647. }
  1648. /* C R E A T E I N T E R F A C E O B J E C T */
  1649. /*------------------------------------------------------------------------------
  1650. ------------------------------------------------------------------------------*/
  1651. HRESULT CCandTipWindowProperty::CreateInterfaceObject( REFIID riid, void **ppvObj )
  1652. {
  1653. CCandUICandTipWindow *pObject;
  1654. HRESULT hr;
  1655. pObject = new CCandUICandTipWindow( this );
  1656. if (pObject == NULL) {
  1657. return E_OUTOFMEMORY;
  1658. }
  1659. hr = pObject->QueryInterface( riid, ppvObj );
  1660. pObject->Release();
  1661. return hr;
  1662. }
  1663. /*============================================================================*/
  1664. /* */
  1665. /* C C A N D T I P B U T T O N P R O P E R T Y */
  1666. /* */
  1667. /*============================================================================*/
  1668. /* C C A N D T I P B U T T O N P R O P E R T Y */
  1669. /*------------------------------------------------------------------------------
  1670. Constructor of CCandTipButtonProperty
  1671. ------------------------------------------------------------------------------*/
  1672. CCandTipButtonProperty::CCandTipButtonProperty( CCandUIPropertyMgr *pPropMgr ) : CCandUIObjectProperty( pPropMgr )
  1673. {
  1674. m_flags.fAllowEnable = FALSE;
  1675. m_flags.fAllowDisable = FALSE;
  1676. m_flags.fAllowIsEnabled = FALSE;
  1677. m_flags.fAllowShow = FALSE;
  1678. m_flags.fAllowHide = FALSE;
  1679. m_flags.fAllowIsVisible = FALSE;
  1680. m_flags.fAllowSetPosition = FALSE;
  1681. m_flags.fAllowGetPosition = TRUE;
  1682. m_flags.fAllowSetSize = FALSE;
  1683. m_flags.fAllowGetSize = TRUE;
  1684. m_flags.fAllowSetFont = FALSE;
  1685. m_flags.fAllowGetFont = FALSE;
  1686. m_flags.fAllowSetText = FALSE;
  1687. m_flags.fAllowGetText = FALSE;
  1688. m_flags.fAllowSetToolTip = TRUE;
  1689. m_flags.fAllowGetToolTip = TRUE;
  1690. m_propEnabled.Set( TRUE );
  1691. m_propVisible.Set( TRUE );
  1692. m_propFont.Set( NULL );
  1693. m_propText.Set( NULL );
  1694. m_propToolTip.Set( NULL );
  1695. CCandUIObjectEventSink::InitEventSink( pPropMgr->GetCandidateUI()->GetUIObjectMgr() );
  1696. }
  1697. /* ~ C C A N D T I P B U T T O N P R O P E R T Y */
  1698. /*------------------------------------------------------------------------------
  1699. Destructor of CCandTipButtonProperty
  1700. ------------------------------------------------------------------------------*/
  1701. CCandTipButtonProperty::~CCandTipButtonProperty( void )
  1702. {
  1703. CCandUIObjectEventSink::DoneEventSink();
  1704. }
  1705. /* O N O B J E C T E V E N T */
  1706. /*------------------------------------------------------------------------------
  1707. ------------------------------------------------------------------------------*/
  1708. void CCandTipButtonProperty::OnObjectEvent( CANDUIOBJECT obj, CANDUIOBJECTEVENT event )
  1709. {
  1710. if (obj != CANDUIOBJ_CANDTIPBUTTON) {
  1711. return;
  1712. }
  1713. switch (event) {
  1714. case CANDUIOBJEV_CREATED: {
  1715. break;
  1716. }
  1717. case CANDUIOBJEV_DESTROYED: {
  1718. m_propPos.Set( 0, 0 );
  1719. m_propSize.Set( 0, 0 );
  1720. break;
  1721. }
  1722. case CANDUIOBJEV_UPDATED: {
  1723. CUIFButton *pUIObject = GetUIObjectMgr()->GetCandTipButtonObj();
  1724. if ((pUIObject != NULL) && pUIObject->IsVisible()) {
  1725. RECT rc;
  1726. pUIObject->GetRect( &rc );
  1727. m_propPos.Set( rc.left, rc.top );
  1728. m_propSize.Set( rc.right - rc.left, rc.bottom - rc.top );
  1729. }
  1730. else {
  1731. m_propPos.Set( 0, 0 );
  1732. m_propSize.Set( 0, 0 );
  1733. }
  1734. break;
  1735. }
  1736. }
  1737. }
  1738. /* C R E A T E I N T E R F A C E O B J E C T */
  1739. /*------------------------------------------------------------------------------
  1740. ------------------------------------------------------------------------------*/
  1741. HRESULT CCandTipButtonProperty::CreateInterfaceObject( REFIID riid, void **ppvObj )
  1742. {
  1743. CCandUICandTipButton *pObject;
  1744. HRESULT hr;
  1745. pObject = new CCandUICandTipButton( this );
  1746. if (pObject == NULL) {
  1747. return E_OUTOFMEMORY;
  1748. }
  1749. hr = pObject->QueryInterface( riid, ppvObj );
  1750. pObject->Release();
  1751. return hr;
  1752. }
  1753. /*============================================================================*/
  1754. /* */
  1755. /* C C A N D U I P R O P E R T Y M G R */
  1756. /* */
  1757. /*============================================================================*/
  1758. /* C C A N D U I P R O P E R T Y M G R */
  1759. /*------------------------------------------------------------------------------
  1760. ------------------------------------------------------------------------------*/
  1761. CCandUIPropertyMgr::CCandUIPropertyMgr( void )
  1762. {
  1763. int i;
  1764. m_pCandUI = NULL;
  1765. m_pCandWindowProp = NULL;
  1766. m_pCandListBoxProp = NULL;
  1767. m_pCandStringProp = NULL;
  1768. m_pCandIndexProp = NULL;
  1769. m_pInlineCommentProp = NULL;
  1770. m_pPopupCommentWindowProp = NULL;
  1771. m_pPopupCommentTitleProp = NULL;
  1772. m_pPopupCommentTextProp = NULL;
  1773. m_pMenuButtonProp = NULL;
  1774. m_pWindowCaptionProp = NULL;
  1775. m_pToolTipProp = NULL;
  1776. m_pExtraCandidateProp = NULL;
  1777. m_pCandRawDataProp = NULL;
  1778. m_pCandTipWindowProp = NULL;
  1779. m_pCandTipButtonProp = NULL;
  1780. for (i = 0; i < CANDUIPROPSINK_MAX; i++) {
  1781. m_rgSink[i] = NULL;
  1782. }
  1783. }
  1784. /* ~ C C A N D U I P R O P E R T Y M G R */
  1785. /*------------------------------------------------------------------------------
  1786. ------------------------------------------------------------------------------*/
  1787. CCandUIPropertyMgr::~CCandUIPropertyMgr( void )
  1788. {
  1789. Uninitialize();
  1790. }
  1791. /* I N I T I A L I Z E */
  1792. /*------------------------------------------------------------------------------
  1793. ------------------------------------------------------------------------------*/
  1794. HRESULT CCandUIPropertyMgr::Initialize( CCandidateUI *pCandUI )
  1795. {
  1796. m_pCandUI = pCandUI;
  1797. m_pCandWindowProp = new CCandWindowProperty( this );
  1798. if (m_pCandWindowProp == NULL) {
  1799. return E_OUTOFMEMORY;
  1800. }
  1801. m_pCandListBoxProp = new CCandListBoxProperty( this );
  1802. if (m_pCandListBoxProp == NULL) {
  1803. return E_OUTOFMEMORY;
  1804. }
  1805. m_pCandStringProp = new CCandStringProperty( this );
  1806. if (m_pCandStringProp == NULL) {
  1807. return E_OUTOFMEMORY;
  1808. }
  1809. m_pCandIndexProp = new CCandIndexProperty( this );
  1810. if (m_pCandIndexProp == NULL) {
  1811. return E_OUTOFMEMORY;
  1812. }
  1813. m_pInlineCommentProp = new CInlineCommentProperty( this );
  1814. if (m_pInlineCommentProp == NULL) {
  1815. return E_OUTOFMEMORY;
  1816. }
  1817. m_pPopupCommentWindowProp = new CPopupCommentWindowProperty( this );
  1818. if (m_pPopupCommentWindowProp == NULL) {
  1819. return E_OUTOFMEMORY;
  1820. }
  1821. m_pPopupCommentTitleProp = new CPopupCommentTitleProperty( this );
  1822. if (m_pPopupCommentTitleProp == NULL) {
  1823. return E_OUTOFMEMORY;
  1824. }
  1825. m_pPopupCommentTextProp = new CPopupCommentTextProperty( this );
  1826. if (m_pPopupCommentTextProp == NULL) {
  1827. return E_OUTOFMEMORY;
  1828. }
  1829. m_pMenuButtonProp = new CMenuButtonProperty( this );
  1830. if (m_pMenuButtonProp == NULL) {
  1831. return E_OUTOFMEMORY;
  1832. }
  1833. m_pWindowCaptionProp = new CWindowCaptionProperty( this );
  1834. if (m_pWindowCaptionProp == NULL) {
  1835. return E_OUTOFMEMORY;
  1836. }
  1837. m_pToolTipProp = new CToolTipProperty( this );
  1838. if (m_pToolTipProp == NULL) {
  1839. return E_OUTOFMEMORY;
  1840. }
  1841. m_pExtraCandidateProp = new CExtraCandidateProperty( this );
  1842. if (m_pExtraCandidateProp == NULL) {
  1843. return E_OUTOFMEMORY;
  1844. }
  1845. m_pCandRawDataProp = new CCandRawDataProperty( this );
  1846. if (m_pCandRawDataProp == NULL) {
  1847. return E_OUTOFMEMORY;
  1848. }
  1849. m_pCandTipWindowProp = new CCandTipWindowProperty( this );
  1850. if (m_pCandTipWindowProp == NULL) {
  1851. return E_OUTOFMEMORY;
  1852. }
  1853. m_pCandTipButtonProp = new CCandTipButtonProperty( this );
  1854. if (m_pCandTipButtonProp == NULL) {
  1855. return E_OUTOFMEMORY;
  1856. }
  1857. #if defined(DEBUG) || defined(_DEBUG)
  1858. // check all reference object are unregistered
  1859. for (int i = 0; i < CANDUIPROPSINK_MAX; i++) {
  1860. Assert( m_rgSink[i] == NULL );
  1861. }
  1862. #endif
  1863. return S_OK;
  1864. }
  1865. /* U N I N I T I A L I Z E */
  1866. /*------------------------------------------------------------------------------
  1867. ------------------------------------------------------------------------------*/
  1868. HRESULT CCandUIPropertyMgr::Uninitialize( void )
  1869. {
  1870. if (m_pCandWindowProp != NULL) {
  1871. delete m_pCandWindowProp;
  1872. m_pCandWindowProp = NULL;
  1873. }
  1874. if (m_pCandListBoxProp != NULL) {
  1875. delete m_pCandListBoxProp;
  1876. m_pCandListBoxProp = NULL;
  1877. }
  1878. if (m_pCandStringProp != NULL) {
  1879. delete m_pCandStringProp;
  1880. m_pCandStringProp = NULL;
  1881. }
  1882. if (m_pCandIndexProp != NULL) {
  1883. delete m_pCandIndexProp;
  1884. m_pCandIndexProp = NULL;
  1885. }
  1886. if (m_pInlineCommentProp != NULL) {
  1887. delete m_pInlineCommentProp;
  1888. m_pInlineCommentProp = NULL;
  1889. }
  1890. if (m_pPopupCommentWindowProp != NULL) {
  1891. delete m_pPopupCommentWindowProp;
  1892. m_pPopupCommentWindowProp = NULL;
  1893. }
  1894. if (m_pPopupCommentTitleProp != NULL) {
  1895. delete m_pPopupCommentTitleProp;
  1896. m_pPopupCommentTitleProp = NULL;
  1897. }
  1898. if (m_pPopupCommentTextProp != NULL) {
  1899. delete m_pPopupCommentTextProp;
  1900. m_pPopupCommentTextProp = NULL;
  1901. }
  1902. if (m_pMenuButtonProp != NULL) {
  1903. delete m_pMenuButtonProp;
  1904. m_pMenuButtonProp = NULL;
  1905. }
  1906. if (m_pWindowCaptionProp != NULL) {
  1907. delete m_pWindowCaptionProp;
  1908. m_pWindowCaptionProp = NULL;
  1909. }
  1910. if (m_pToolTipProp != NULL) {
  1911. delete m_pToolTipProp;
  1912. m_pToolTipProp = NULL;
  1913. }
  1914. if (m_pExtraCandidateProp != NULL) {
  1915. delete m_pExtraCandidateProp;
  1916. m_pExtraCandidateProp = NULL;
  1917. }
  1918. if (m_pCandRawDataProp != NULL) {
  1919. delete m_pCandRawDataProp;
  1920. m_pCandRawDataProp = NULL;
  1921. }
  1922. if (m_pCandTipWindowProp != NULL) {
  1923. delete m_pCandTipWindowProp;
  1924. m_pCandTipWindowProp = NULL;
  1925. }
  1926. if (m_pCandTipButtonProp != NULL) {
  1927. delete m_pCandTipButtonProp;
  1928. m_pCandTipButtonProp = NULL;
  1929. }
  1930. #if defined(DEBUG) || defined(_DEBUG)
  1931. // check all reference object are unregistered
  1932. for (int i = 0; i < CANDUIPROPSINK_MAX; i++) {
  1933. Assert( m_rgSink[i] == NULL );
  1934. }
  1935. #endif
  1936. return S_OK;
  1937. }
  1938. /* A D V I S E E V E N T S I N K */
  1939. /*------------------------------------------------------------------------------
  1940. ------------------------------------------------------------------------------*/
  1941. HRESULT CCandUIPropertyMgr::AdviseEventSink( CCandUIPropertyEventSink *pSink )
  1942. {
  1943. int i;
  1944. for (i = 0; i < CANDUIPROPSINK_MAX; i++) {
  1945. if (m_rgSink[i] == NULL) {
  1946. m_rgSink[i] = pSink;
  1947. return S_OK;
  1948. }
  1949. }
  1950. Assert( FALSE );
  1951. return E_FAIL;
  1952. }
  1953. /* U N A D V I S E E V E N T S I N K */
  1954. /*------------------------------------------------------------------------------
  1955. ------------------------------------------------------------------------------*/
  1956. HRESULT CCandUIPropertyMgr::UnadviseEventSink( CCandUIPropertyEventSink *pSink )
  1957. {
  1958. int i;
  1959. for (i = 0; i < CANDUIPROPSINK_MAX; i++) {
  1960. if (m_rgSink[i] == pSink) {
  1961. m_rgSink[i] = NULL;
  1962. return S_OK;
  1963. }
  1964. }
  1965. Assert( FALSE );
  1966. return E_FAIL;
  1967. }
  1968. /* N O T I F Y P R O P E R T Y U P D A T E */
  1969. /*------------------------------------------------------------------------------
  1970. ------------------------------------------------------------------------------*/
  1971. void CCandUIPropertyMgr::NotifyPropertyUpdate( CANDUIPROPERTY prop, CANDUIPROPERTYEVENT event )
  1972. {
  1973. int i;
  1974. if (m_pCandWindowProp) {
  1975. m_pCandWindowProp->OnPropertyUpdated( prop, event );
  1976. }
  1977. if (m_pCandListBoxProp) {
  1978. m_pCandListBoxProp->OnPropertyUpdated( prop, event );
  1979. }
  1980. if (m_pCandStringProp) {
  1981. m_pCandStringProp->OnPropertyUpdated( prop, event );
  1982. }
  1983. if (m_pCandIndexProp) {
  1984. m_pCandIndexProp->OnPropertyUpdated( prop, event );
  1985. }
  1986. if (m_pInlineCommentProp) {
  1987. m_pInlineCommentProp->OnPropertyUpdated( prop, event );
  1988. }
  1989. if (m_pPopupCommentWindowProp) {
  1990. m_pPopupCommentWindowProp->OnPropertyUpdated( prop, event );
  1991. }
  1992. if (m_pPopupCommentTitleProp) {
  1993. m_pPopupCommentTitleProp->OnPropertyUpdated( prop, event );
  1994. }
  1995. if (m_pPopupCommentTextProp) {
  1996. m_pPopupCommentTextProp->OnPropertyUpdated( prop, event );
  1997. }
  1998. if (m_pMenuButtonProp) {
  1999. m_pMenuButtonProp->OnPropertyUpdated( prop, event );
  2000. }
  2001. if (m_pWindowCaptionProp) {
  2002. m_pWindowCaptionProp->OnPropertyUpdated( prop, event );
  2003. }
  2004. if (m_pToolTipProp) {
  2005. m_pToolTipProp->OnPropertyUpdated( prop, event );
  2006. }
  2007. if (m_pExtraCandidateProp) {
  2008. m_pExtraCandidateProp->OnPropertyUpdated( prop, event );
  2009. }
  2010. if (m_pCandRawDataProp) {
  2011. m_pCandRawDataProp->OnPropertyUpdated( prop, event );
  2012. }
  2013. if (m_pCandTipWindowProp) {
  2014. m_pCandTipWindowProp->OnPropertyUpdated( prop, event );
  2015. }
  2016. if (m_pCandTipButtonProp) {
  2017. m_pCandTipButtonProp->OnPropertyUpdated( prop, event );
  2018. }
  2019. for (i = 0; i < CANDUIPROPSINK_MAX; i++) {
  2020. if (m_rgSink[i] != NULL) {
  2021. m_rgSink[i]->OnPropertyUpdated( prop, event );
  2022. }
  2023. }
  2024. }
  2025. /* G E T O B J E C T */
  2026. /*------------------------------------------------------------------------------
  2027. ------------------------------------------------------------------------------*/
  2028. HRESULT CCandUIPropertyMgr::GetObject( REFIID riid, void **ppvObj )
  2029. {
  2030. CCandUIObjectProperty *pProperty = NULL;
  2031. if (ppvObj == NULL) {
  2032. return E_INVALIDARG;
  2033. }
  2034. // find property
  2035. if (IsEqualGUID( riid, IID_ITfCandUICandWindow )) {
  2036. pProperty = m_pCandWindowProp;
  2037. }
  2038. if (IsEqualGUID( riid, IID_ITfCandUICandListBox )) {
  2039. pProperty = m_pCandListBoxProp;
  2040. }
  2041. if (IsEqualGUID( riid, IID_ITfCandUICandString )) {
  2042. pProperty = m_pCandStringProp;
  2043. }
  2044. if (IsEqualGUID( riid, IID_ITfCandUICandIndex )) {
  2045. pProperty = m_pCandIndexProp;
  2046. }
  2047. if (IsEqualGUID( riid, IID_ITfCandUIInlineComment )) {
  2048. pProperty = m_pInlineCommentProp;
  2049. }
  2050. if (IsEqualGUID( riid, IID_ITfCandUIPopupCommentWindow )) {
  2051. pProperty = m_pPopupCommentWindowProp;
  2052. }
  2053. if (IsEqualGUID( riid, IID_ITfCandUIPopupCommentTitle )) {
  2054. pProperty = m_pPopupCommentTitleProp;
  2055. }
  2056. if (IsEqualGUID( riid, IID_ITfCandUIPopupCommentText )) {
  2057. pProperty = m_pPopupCommentTextProp;
  2058. }
  2059. if (IsEqualGUID( riid, IID_ITfCandUIMenuButton )) {
  2060. pProperty = m_pMenuButtonProp;
  2061. }
  2062. if (IsEqualGUID( riid, IID_ITfCandUICaption )) {
  2063. pProperty = m_pWindowCaptionProp;
  2064. }
  2065. if (IsEqualGUID( riid, IID_ITfCandUIToolTip )) {
  2066. pProperty = m_pToolTipProp;
  2067. }
  2068. if (IsEqualGUID( riid, IID_ITfCandUIExtraCandidate )) {
  2069. pProperty = m_pExtraCandidateProp;
  2070. }
  2071. if (IsEqualGUID( riid, IID_ITfCandUIRawData )) {
  2072. pProperty = m_pCandRawDataProp;
  2073. }
  2074. if (IsEqualGUID( riid, IID_ITfCandUICandTipWindow )) {
  2075. pProperty = m_pCandTipWindowProp;
  2076. }
  2077. if (IsEqualGUID( riid, IID_ITfCandUICandTipButton )) {
  2078. pProperty = m_pCandTipButtonProp;
  2079. }
  2080. if (pProperty == NULL) {
  2081. return E_FAIL;
  2082. }
  2083. // create interface object
  2084. return pProperty->CreateInterfaceObject( riid, ppvObj );
  2085. }
  2086. /*============================================================================*/
  2087. /* */
  2088. /* C C A N D U I P R O P E R T Y E V E N T S I N K */
  2089. /* */
  2090. /*============================================================================*/
  2091. /* C C A N D U I P R O P E R T Y E V E N T S I N K */
  2092. /*------------------------------------------------------------------------------
  2093. ------------------------------------------------------------------------------*/
  2094. CCandUIPropertyEventSink::CCandUIPropertyEventSink( void )
  2095. {
  2096. m_pPropertyMgr = NULL;
  2097. }
  2098. /* ~ C C A N D U I P R O P E R T Y E V E N T S I N K */
  2099. /*------------------------------------------------------------------------------
  2100. ------------------------------------------------------------------------------*/
  2101. CCandUIPropertyEventSink::~CCandUIPropertyEventSink( void )
  2102. {
  2103. Assert( m_pPropertyMgr == NULL );
  2104. if (m_pPropertyMgr != NULL) {
  2105. DoneEventSink();
  2106. }
  2107. }
  2108. /* I N I T E V E N T S I N K */
  2109. /*------------------------------------------------------------------------------
  2110. ------------------------------------------------------------------------------*/
  2111. HRESULT CCandUIPropertyEventSink::InitEventSink( CCandUIPropertyMgr *pPropertyMgr )
  2112. {
  2113. Assert( pPropertyMgr != NULL );
  2114. Assert( m_pPropertyMgr == NULL );
  2115. if (pPropertyMgr == NULL) {
  2116. return E_INVALIDARG;
  2117. }
  2118. m_pPropertyMgr = pPropertyMgr;
  2119. return m_pPropertyMgr->AdviseEventSink( this );
  2120. }
  2121. /* D O N E E V E N T S I N K */
  2122. /*------------------------------------------------------------------------------
  2123. ------------------------------------------------------------------------------*/
  2124. HRESULT CCandUIPropertyEventSink::DoneEventSink( void )
  2125. {
  2126. HRESULT hr;
  2127. Assert( m_pPropertyMgr != NULL );
  2128. if (m_pPropertyMgr == NULL) {
  2129. return E_FAIL;
  2130. }
  2131. hr = m_pPropertyMgr->UnadviseEventSink( this );
  2132. m_pPropertyMgr = NULL;
  2133. return hr;
  2134. }