PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: ClipBoard.h * 00003 * 00004 * Copyright (C) 2002-2012 The PixelLight Team (http://www.pixellight.org/) 00005 * 00006 * This file is part of PixelLight. 00007 * 00008 * PixelLight is free software: you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License as published by 00010 * the Free Software Foundation, either version 3 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * PixelLight is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public License 00019 * along with PixelLight. If not, see <http://www.gnu.org/licenses/>. 00020 \*********************************************************/ 00021 00022 00023 #ifndef __PLGUI_CLIPBOARD_H__ 00024 #define __PLGUI_CLIPBOARD_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include <PLCore/String/String.h> 00032 #include "PLGui/Gui/Data/DataObject.h" 00033 00034 00035 //[-------------------------------------------------------] 00036 //[ Namespace ] 00037 //[-------------------------------------------------------] 00038 namespace PLGui { 00039 00040 00041 //[-------------------------------------------------------] 00042 //[ Forward declarations ] 00043 //[-------------------------------------------------------] 00044 class Gui; 00045 class ClipBoardImpl; 00046 00047 00048 //[-------------------------------------------------------] 00049 //[ Classes ] 00050 //[-------------------------------------------------------] 00051 /** 00052 * @brief 00053 * Clipboard 00054 * 00055 * @note 00056 * - Implementation of the bridge design pattern, this class is the abstraction 00057 */ 00058 class ClipBoard { 00059 00060 00061 //[-------------------------------------------------------] 00062 //[ Friends ] 00063 //[-------------------------------------------------------] 00064 friend class Gui; 00065 00066 00067 //[-------------------------------------------------------] 00068 //[ Public functions ] 00069 //[-------------------------------------------------------] 00070 public: 00071 /** 00072 * @brief 00073 * Constructor 00074 * 00075 * @param[in] cGui 00076 * Owner GUI 00077 */ 00078 PLGUI_API ClipBoard(Gui &cGui); 00079 00080 /** 00081 * @brief 00082 * Destructor 00083 */ 00084 PLGUI_API ~ClipBoard(); 00085 00086 /** 00087 * @brief 00088 * Get owner GUI 00089 * 00090 * @return 00091 * Pointer to GUI object (never a null pointer) 00092 */ 00093 PLGUI_API Gui *GetGui() const; 00094 00095 /** 00096 * @brief 00097 * Get implementation 00098 * 00099 * @return 00100 * Pointer to platform specific implementation 00101 */ 00102 PLGUI_API ClipBoardImpl *GetImpl() const; 00103 00104 /** 00105 * @brief 00106 * Get data from clipboard 00107 * 00108 * @return 00109 * Data 00110 */ 00111 PLGUI_API DataObject GetData(); 00112 00113 /** 00114 * @brief 00115 * Save data to clipboard 00116 * 00117 * @param[in] cData 00118 * Data 00119 */ 00120 PLGUI_API void SetData(const DataObject &cData); 00121 00122 /** 00123 * @brief 00124 * Get text from clipboard 00125 * 00126 * @return 00127 * String 00128 */ 00129 PLGUI_API PLCore::String GetText(); 00130 00131 /** 00132 * @brief 00133 * Save text to clipboard 00134 * 00135 * @param[in] sText 00136 * String 00137 */ 00138 PLGUI_API void SetText(const PLCore::String &sText); 00139 00140 00141 //[-------------------------------------------------------] 00142 //[ Protected functions ] 00143 //[-------------------------------------------------------] 00144 protected: 00145 /** 00146 * @brief 00147 * Initialize clipboard (create backend) 00148 */ 00149 PLGUI_API void InitClipBoard(); 00150 00151 00152 //[-------------------------------------------------------] 00153 //[ Protected data ] 00154 //[-------------------------------------------------------] 00155 protected: 00156 Gui *m_pGui; /**< Pointer to GUI */ 00157 ClipBoardImpl *m_pImpl; /**< Clipboard implementation */ 00158 00159 00160 }; 00161 00162 00163 //[-------------------------------------------------------] 00164 //[ Namespace ] 00165 //[-------------------------------------------------------] 00166 } // PLGui 00167 00168 00169 #endif // __PLGUI_CLIPBOARD_H__
|