acuiNavDialog.h 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright 2015 Autodesk, Inc. All rights reserved.
  4. //
  5. // Use of this software is subject to the terms of the Autodesk license
  6. // agreement provided at the time of installation or download, or which
  7. // otherwise accompanies this software in either electronic or hard copy form.
  8. //
  9. //////////////////////////////////////////////////////////////////////////////
  10. //
  11. // Name: AutoCAD file navigation dialog header file
  12. //
  13. //
  14. //////////////////////////////////////////////////////////////////////////////
  15. #ifndef ACUINAVDIALOG_H_
  16. #define ACUINAVDIALOG_H_
  17. #include "anav.h"
  18. // Forward class declarations.
  19. class CAcUiNavPreviewButton;
  20. typedef enum
  21. {
  22. // Open with no template flags
  23. acUiOpenNoTemplateNone = 0x0000,
  24. acUiOpenNoTemplateImperail = 0x0001,
  25. acUiOpenNoTemplateMetric = 0x0002
  26. } AcUiOpenNoTemplateFlag;
  27. /////////////////////////////////////////////////////////////////////////////
  28. // File Navigation dialog - this is the AutoCAD file navigation dialog.
  29. class ACUI_PORT CAcUiNavDialog : public CNavDialog {
  30. DECLARE_DYNAMIC(CAcUiNavDialog)
  31. public:
  32. // Constructor and destructor.
  33. CAcUiNavDialog (
  34. CNavDataArray& dataArray, // For results of the dialog.
  35. CNavFilterArray& filterArray, // Files of type.
  36. UINT idd=0, // Template id, 0 means use the default template for AutoCAD dialog.
  37. CWnd *pParent=NULL, // Dialog parent. NULL means the desktop.
  38. HINSTANCE hDialogResource=NULL // Resource ID where template is found. NULL means use the default.
  39. );
  40. virtual ~CAcUiNavDialog ();
  41. // Dialog initialization.
  42. virtual BOOL OnInitDialog ();
  43. // Get the "Recent" directory under the "Application Data"
  44. // directory of the OS for use with the "History" places item.
  45. virtual BOOL GetRecentDirectory(CString& strRecent);
  46. // Locate a file in a search path for use with the "Locate" tools menu item.
  47. virtual BOOL FindInSearchPath(LPCTSTR sBase, CString* pFullPath);
  48. // Get the default URL to use in the web browser when the web button is selected.
  49. virtual void GetDefaultBrowserStartURL(CString& strStartPage);
  50. // Launch a browser and get a URL. Called when the web button is selected.
  51. virtual BOOL LaunchBrowserDialog(CString& strSelectedURL, LPCTSTR strDialogCaption,
  52. LPCTSTR strOk, LPCTSTR strStartPage);
  53. // Display an error in trying to locate a file in the search path when the "Locate"
  54. // tools menu item is selected.
  55. virtual void DisplaySearchError(LPCTSTR sBase);
  56. // Called when the user choses "Locate" form tools menu.
  57. virtual void OnDoLocate();
  58. // Return the product name to be used when registering extensions.
  59. virtual BOOL GetProductName(CString& strProduct);
  60. // Called at the start of a remote file download operation.
  61. virtual BOOL BeginDownloadFiles(CStringArray& strURLs, CDWordArray& dwActionCodes);
  62. // Callback to get additional action code bits for a remote download.
  63. virtual DWORD GetDownloadActionCodes(CString& strURL);
  64. // Called when the preview needs painting after it has been erased.
  65. virtual void OnPaintPreview(LPCTSTR strFullPath, CWnd* previewWnd);
  66. // Called when the help button is selected.
  67. virtual void OnDialogHelp();
  68. virtual void OnDialogHelp(LPCTSTR pTag);
  69. BOOL GetPreviewPresent(); // Does the dialog have an AutoCAD preview window?
  70. void SetPreviewPresent(BOOL preview); // Set the AutoCAD preview window as present.
  71. BOOL GetPreviewVisible(); // Is the AutoCAD preview window visible?
  72. void SetPreviewVisible(BOOL visible); // Set the AutoCAD preview window visible.
  73. BOOL GetInitialViewButtonChecked(); // Is the initial view checkbox checked?
  74. void ConvertFlagsToState(int nFlags); // Sets up dialog internal state. FOR INTERNAL USE ONLY.
  75. AcUiOpenNoTemplateFlag GetOpenNoTemplateSelection();
  76. short GetUpdateThumbnailOverride(); // Get the override value for the UPDATETHUMBNAIL sysvar
  77. BOOL GetSaveToCloud(); // Does the user want to save this drawing to the cloud
  78. int GetCloudLocation(); // Get the location of the cloud places item
  79. BOOL GetCloudFolder(CString & folder); // Get the sysvar ONLINEFOLDER
  80. BOOL ResetToCloudLocation();
  81. void SetCloudUIState(); // Manage the display of custom controls
  82. void SetCloudControlsVisible(BOOL show); // Display cloud controls when cloud selected
  83. // REMEMBERFOLDERS support
  84. void SetUseRememberFolders(bool bUseRememberFolders);
  85. bool GetUseRememberFolders() const;
  86. public:
  87. //CAdUiBaseDialog overrides
  88. //turn off warning about non-standard extensions used,
  89. //but still use the override keyword on the MS compiler
  90. //to get early warning if these are no longer overrides
  91. #pragma warning(push)
  92. #pragma warning(disable: 4481)
  93. virtual void EnableFloatingWindows (BOOL allow) ADESK_OVERRIDE;
  94. virtual int IsMultiDocumentActivationEnabled() ADESK_OVERRIDE;
  95. virtual int EnableMultiDocumentActivation(BOOL bEnable) ADESK_OVERRIDE;
  96. #pragma warning(pop)
  97. protected:
  98. virtual void OnFolderItemChange(); // Called when the selection changes.
  99. virtual void OnFilterChange(); // Called when the filter changes.
  100. virtual BOOL OnFileNameOK (); // Called when the commit button is clicked.
  101. virtual void OnFileNameChange (); // Called when thetext changes in the file name editbox.
  102. virtual void PrepareOkMenu(CMenu* pMenu);// Possibly alter the base ok menu.
  103. virtual void PrepareViewsMenu(CMenu* pMenu);// Possibly alter the base views menu.
  104. virtual void PrepareToolsMenu(CMenu* pMenu);// Possibly alter the base tools menu.
  105. virtual void OnURLDownloadSuccess(CString& strURL);// Called when checking for errors after downloading files.
  106. virtual BOOL GetOptionsState(); // Check for a tab in the options dialog for the current combination of filetype and get/put file..
  107. virtual void OnCancel();
  108. virtual void OnOK();
  109. void Do3DDwfOptionsDialog(); // Display the 3D Dwf option dialog.
  110. void DoFbxOptionsDialog(); // Display the FBX options dialog.
  111. void InitPreviewState(); // Initialize the preview control.
  112. protected:
  113. //{{AFX_MSG(CAcUiNavDialog)
  114. afx_msg void OnOpenNoTemplateImperial(); // Called when "open with no template - Imperial" item is selected.
  115. afx_msg void OnOpenNoTemplateMetric(); // Called when "open with no template - Metric" item is selected.
  116. afx_msg void OnOpenMenuPartialOpen(); // Called when the partial open item is selected.
  117. afx_msg void OnOpenMenuPartialOpenReadOnly();// Called when the partial open read only item is selected.
  118. afx_msg void OnViewsMenuPreview(); // Called when the preview item is selected from the view menu.
  119. afx_msg void OnToolsMenuOptions(); // Called when the options item is selected from the view menu.
  120. afx_msg void OnToolsMenuSecurity(); // Called when the security item is selected from the tools menu.
  121. afx_msg void OnDestroy();
  122. afx_msg void OnSize(UINT nType, int cx, int cy);
  123. afx_msg void OnUpdateThumbnailCheck(); // Called when the update thumbnail checkbox is selected.
  124. afx_msg void OnPlacesChanged(); // Places list box changed
  125. afx_msg void OnOnlineOptions(); // Fire up the Preferences dialog Online tab
  126. afx_msg void OnShowReferenceFiles(); // Show cloud reference files
  127. //}}AFX_MSG
  128. DECLARE_MESSAGE_MAP()
  129. private:
  130. // These members are used by AutoCAD's dialogs.
  131. short m_CmdInProgress;
  132. short m_nUpdateThumbnailOverride; // The override value for the UPDATETHUMBNAIL sysvar.
  133. BOOL m_bIsOpen; // This is the AutoCAD file OPEN dialog.
  134. BOOL m_bIsSaveAs; // This is the AutoCAD file SAVEAS dialog.
  135. BOOL m_bIsRecover; // We are doing a RECOVER.
  136. BOOL m_bPartialOpenAlwaysDisabled; // Set by OEM.
  137. BOOL m_bInitialViewButtonPresent; // There is an initial view checkbox.
  138. BOOL m_bInitialViewButtonChecked; // Initial view checkbox is checked.
  139. BOOL m_bPartialOpenPresent; // There is a partial open button.
  140. BOOL m_bOptionsPresent; // There is an OPTIONS menu item.
  141. BOOL m_bPreviewPresent; // There is a preview.
  142. BOOL m_bPreviewVisible; // Preview is visible.
  143. BOOL m_bSaveToCloud; // Save the local file to the cloud.
  144. BOOL m_bCloudControlsVisible; //Override cloud controls
  145. BOOL m_bOpenNoTemplate; // DLFNOTEMPIPR, Open with no Template - Imperial or Metric
  146. AcUiOpenNoTemplateFlag m_nOpenNoTemplateSelection;
  147. CAcUiNavPreviewButton* m_previewButton;
  148. CBitmap m_cloudDocsBitmap;
  149. BOOL m_bIsExport; // This is the AutoCAD file Export dialog.
  150. BOOL CanPartiallyOpen(LPCTSTR szfullPath);// Can the file be partially opened?
  151. bool ApplyRememberFoldersInitialization(int rememberFolders);
  152. bool ApplyRememberFoldersOnOk();
  153. void GetCloudMode();
  154. bool m_bUseRememberFolders;
  155. BOOL ResetPlacesOnCloudLoginFailure();
  156. void HideControls();
  157. void UpdateInitialFolder(); // Called to adjust the initial folder if necessary
  158. int CheckSharedFilePrivileges(const CString & filename);
  159. //use static variable instead of to avoid binary compatibility.
  160. static BOOL m_bOriginalMultiSelAllowed; // Log original multi-selection setting
  161. BOOL m_bOpenSample;
  162. };
  163. #endif // ACUINAVDIALOG_H_