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.

143 lines
5.6 KiB

  1. #ifndef __CAMDLG_H_INCLUDED
  2. #define __CAMDLG_H_INCLUDED
  3. #include <windows.h>
  4. #include "wia.h"
  5. #include "wiadevd.h"
  6. #include "citemlst.h"
  7. #include "simarray.h"
  8. #include "bkthread.h"
  9. #include "gwiaevnt.h"
  10. #include "createtb.h"
  11. #define DEF_PICTURE_ICON 0
  12. #define DEF_FOLDER_ICON 1
  13. #define DEF_PARENT_ICON 2
  14. class CCameraAcquireDialog
  15. {
  16. private:
  17. enum
  18. {
  19. MULTISEL_MODE = 1,
  20. SINGLESEL_MODE = 2,
  21. BOTH_MODES = 3
  22. };
  23. private:
  24. HWND m_hWnd;
  25. bool m_bPreviewActive;
  26. SIZE m_sizeMinimumWindow;
  27. SIZE m_sizeThumbnails;
  28. PDEVICEDIALOGDATA m_pDeviceDialogData;
  29. SIZE m_CurrentAspectRatio;
  30. CCameraItemList m_CameraItemList;
  31. CCameraItem *m_pCurrentParentItem;
  32. CThreadMessageQueue *m_pThreadMessageQueue;
  33. CSimpleEvent m_CancelEvent;
  34. bool m_bFirstTime;
  35. HANDLE m_hBackgroundThread;
  36. HIMAGELIST m_hImageList;
  37. HFONT m_hBigFont;
  38. DWORD m_nDialogMode;
  39. int m_nParentFolderImageListIndex;
  40. HACCEL m_hAccelTable;
  41. int m_nListViewWidth;
  42. HICON m_hIconLarge;
  43. HICON m_hIconSmall;
  44. CComPtr<IUnknown> m_DisconnectEvent;
  45. CComPtr<IUnknown> m_DeleteItemEvent;
  46. CComPtr<IUnknown> m_CreateItemEvent;
  47. bool m_bTakePictureIsSupported;
  48. ToolbarHelper::CToolbarBitmapInfo m_ToolbarBitmapInfo;
  49. private:
  50. // No implementation
  51. CCameraAcquireDialog(void);
  52. CCameraAcquireDialog &operator=( const CCameraAcquireDialog & );
  53. CCameraAcquireDialog( const CCameraAcquireDialog & );
  54. private:
  55. CCameraAcquireDialog( HWND hWnd );
  56. protected:
  57. HWND CreateCameraDialogToolbar(VOID);
  58. VOID ResizeAll(VOID);
  59. HRESULT EnumerateItems( CCameraItem *pCurrentParent, IEnumWiaItem *pIWiaEnumItem );
  60. HRESULT EnumerateAllCameraItems(void);
  61. bool PopulateList( CCameraItem *pOldParent=NULL );
  62. HBITMAP CreateDefaultThumbnail( HDC hDC, HFONT hFont, int nWidth, int nHeight, LPCWSTR pszTitle, int nType );
  63. void CreateThumbnails( bool bForce=false );
  64. bool FindMaximumThumbnailSize(void);
  65. int GetSelectionIndices( CSimpleDynamicArray<int> &aIndices );
  66. CCameraItem *GetListItemNode( int nIndex );
  67. bool ChangeFolder( CCameraItem *pNode );
  68. bool ChangeToSelectedFolder(void);
  69. bool IsAFolderSelected(void);
  70. bool SetSelectedListItem( int nIndex );
  71. int FindItemInList( CCameraItem *pItem );
  72. void RequestThumbnails( CCameraItem *pRoot );
  73. void UpdatePreview(void);
  74. CCameraItem *GetCurrentPreviewItem(void);
  75. bool SetCurrentPreviewImage( const CSimpleString &strFilename, const CSimpleString &strTitle = TEXT("") );
  76. LRESULT OnEnterSizeMove( WPARAM, LPARAM );
  77. LRESULT OnExitSizeMove( WPARAM, LPARAM );
  78. void CancelAllPreviewRequests( CCameraItem *pRoot );
  79. void MarkItemDeletePending( int nIndex, bool bSet );
  80. void DeleteItem( CCameraItem *pItemNode );
  81. void HandleSelectionChange(void);
  82. void CreateThumbnails( CCameraItem *pRoot, HIMAGELIST hImageList, bool bForce );
  83. void CreateThumbnail( CCameraItem *pCurr, HIMAGELIST hImageList, bool bForce );
  84. void OnItemCreatedEvent( CGenericWiaEventHandler::CEventMessage *pEventMessage );
  85. LRESULT OnInitDialog( WPARAM, LPARAM );
  86. LRESULT OnSize( WPARAM, LPARAM );
  87. LRESULT OnShow( WPARAM, LPARAM );
  88. LRESULT OnGetMinMaxInfo( WPARAM, LPARAM );
  89. LRESULT OnDestroy( WPARAM, LPARAM );
  90. LRESULT OnDblClkImageList( WPARAM, LPARAM );
  91. LRESULT OnImageListItemChanged( WPARAM, LPARAM );
  92. LRESULT OnImageListKeyDown( WPARAM, LPARAM );
  93. LRESULT OnTimer( WPARAM, LPARAM );
  94. LRESULT OnHelp( WPARAM, LPARAM );
  95. LRESULT OnContextMenu( WPARAM, LPARAM );
  96. LRESULT OnSysColorChange( WPARAM, LPARAM );
  97. LRESULT OnChangeToParent( WPARAM, LPARAM );
  98. LRESULT OnPostInit( WPARAM, LPARAM );
  99. LRESULT OnThumbnailStatus( WPARAM, LPARAM );
  100. LRESULT OnPreviewStatus( WPARAM, LPARAM );
  101. LRESULT OnPreviewPercent( WPARAM, LPARAM );
  102. LRESULT OnItemDeleted( WPARAM, LPARAM );
  103. LRESULT OnWiaEvent( WPARAM, LPARAM );
  104. VOID OnParentDir( WPARAM, LPARAM );
  105. VOID OnPreviewMode( WPARAM, LPARAM );
  106. VOID OnIconMode( WPARAM, LPARAM );
  107. VOID OnDelete( WPARAM, LPARAM );
  108. VOID OnOK( WPARAM, LPARAM );
  109. VOID OnCancel( WPARAM, LPARAM );
  110. VOID OnProperties( WPARAM, LPARAM );
  111. VOID OnSelectAll( WPARAM, LPARAM );
  112. VOID OnTakePicture( WPARAM, LPARAM );
  113. LRESULT OnNotify( WPARAM wParam, LPARAM lParam );
  114. LRESULT OnCommand( WPARAM wParam, LPARAM lParam );
  115. // Hook procedure and static variables used to handle accelerators
  116. static HWND s_hWndDialog;
  117. static HHOOK s_hMessageHook;
  118. static LRESULT CALLBACK DialogHookProc( int nCode, WPARAM wParam, LPARAM );
  119. public:
  120. static INT_PTR CALLBACK DialogProc( HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam );
  121. public: // For now
  122. static BOOL WINAPI OnThreadDestroy( CThreadMessage *pMsg );
  123. static BOOL WINAPI OnGetThumbnail( CThreadMessage *pMsg );
  124. static BOOL WINAPI OnGetPreview( CThreadMessage *pMsg );
  125. static BOOL WINAPI OnThreadDeleteItem( CThreadMessage *pMsg );
  126. };
  127. #endif //__CAMDLG_H_INCLUDED