瀏覽代碼

Doxygen comments for PolyUIFileDialog

cib 12 年之前
父節點
當前提交
d757905a32
共有 1 個文件被更改,包括 38 次插入6 次删除
  1. 38 6
      Modules/Contents/UI/Include/PolyUIFileDialog.h

+ 38 - 6
Modules/Contents/UI/Include/PolyUIFileDialog.h

@@ -1,16 +1,16 @@
 /*
  Copyright (C) 2012 by Ivan Safrin
- 
+
  Permission is hereby granted, free of charge, to any person obtaining a copy
  of this software and associated documentation files (the "Software"), to deal
  in the Software without restriction, including without limitation the rights
  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  copies of the Software, and to permit persons to whom the Software is
  furnished to do so, subject to the following conditions:
- 
+
  The above copyright notice and this permission notice shall be included in
  all copies or substantial portions of the Software.
- 
+
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
@@ -31,7 +31,7 @@
 #include "PolyInputEvent.h"
 
 namespace Polycode {
-	
+
 	class CreateFolderWindow : public UIWindow {
 		public:
 			CreateFolderWindow();
@@ -57,22 +57,54 @@ namespace Polycode {
 			ScreenImage *icon;
 	};
 
+	/**
+	 * A dialog that allows the user to choose a file or directory from a
+	 * file system.
+	 */
 	class UIFileDialog : public UIWindow {
 		public:
+			/**
+			 * Create a new file dialog.
+			 *
+			 * @param baseDir The top-level directory, only entries in this directory and below can be selected.
+			 * @param foldersOnly If true, directories will be selected. If false, files will be selected.
+			 * @param extensions A list of accepted file extensions.
+			 * @param allowMultiple If true, multiple entries can be selected at once.
+			 */
 			UIFileDialog(String baseDir, bool foldersOnly, std::vector<String> extensions, bool allowMultiple);
 			virtual ~UIFileDialog();
 
 			void onClose();
 			void handleEvent(Event *event);
+
+			/**
+			 * Clears all entries in the file dialog.
+			 */
 			void clearEntries();
+
+			/**
+			 * Set a new top-level directory to display.
+			 */
 			void showFolder(String folderPath);
-	
+
+			/**
+			 * Returns whether a file with a specific file extension
+			 * can be selected.
+			 *
+			 * @param extension The file extension to be tested.
+			 */
 			bool canOpen(String extension);
 
 			void addToSidebar(String path, String name);
 
 			void Update();
 
+			/**
+			 * Get the selected entry.
+			 *
+			 * @return Full path of the selected entry
+			 * 		   (base path + relative path to top level directory)
+			 */
 			String getSelection();
 		protected:
 
@@ -99,7 +131,7 @@ namespace Polycode {
 			std::vector<String> extensions;
 			std::vector<UIFileDialogEntry*> entries;
 			std::vector<UIFileDialogEntry*> sideBarEntries;
-			UIElement *entryHolder;		
+			UIElement *entryHolder;
 	};
 }