Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members

gadget_w_caret.h

Go to the documentation of this file.
00001 /*
00002     File        : gadget_w_caret.h
00003     Date        : 19-Sep-02
00004     Description : Class to represent a toolbox gadget that allows the writable
00005                   fields before and after it to be changed.
00006 
00007     Copyright © 1995-2002 Alexander Thoukydides
00008 
00009     This program is free software; you can redistribute it and/or
00010     modify it under the terms of the GNU General Public License
00011     as published by the Free Software Foundation; either version 2
00012     of the License, or (at your option) any later version.
00013 
00014     This program is distributed in the hope that it will be useful,
00015     but WITHOUT ANY WARRANTY; without even the implied warranty of
00016     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00017     GNU General Public License for more details.
00018 
00019     You should have received a copy of the GNU General Public License
00020     along with this program; if not, write to the Free Software
00021     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
00022 */
00023 
00024 // Only include header file once
00025 #ifndef gadget_w_caret_h
00026 #define gadget_w_caret_h
00027 
00028 // Include oslib header files
00029 #include "oslib/gadget.h"
00030 #include "oslib/macros.h"
00031 
00032 // A class to represent a gadget with selectable before and after fields
00033 class gadget_w_caret
00034 {
00035 public:
00036 
00037     /*
00038         Parameters  : component - The component ID of the previous field.
00039         Returns     : void
00040         Description : Set the component ID of the writable field before this
00041                       one.
00042     */
00043     void set_before(toolbox_c component = toolbox_NULL_COMPONENT);
00044 
00045     /*
00046         Parameters  : void
00047         Returns     : toolbox_c - The component ID of the previous field.
00048         Description : Get the component ID of the writable field before this
00049                       one.
00050     */
00051     toolbox_c get_before() const;
00052 
00053     /*
00054         Parameters  : component - The component ID of the next field.
00055         Returns     : void
00056         Description : Set the component ID of the writable field after this
00057                       one.
00058     */
00059     void set_after(toolbox_c component = toolbox_NULL_COMPONENT);
00060 
00061     /*
00062         Parameters  : void
00063         Returns     : toolbox_c - The component ID of the next field.
00064         Description : Get the component ID of the writable field after this
00065                       one.
00066     */
00067     toolbox_c get_after() const;
00068 
00069 protected:
00070 
00071     /*
00072         Parameters  : component - The component ID of the previous field.
00073         Returns     : void
00074         Description : Set the component ID of the writable field before this
00075                       one.
00076     */
00077     virtual void _set_before(toolbox_c component) = 0;
00078 
00079     /*
00080         Parameters  : void
00081         Returns     : toolbox_c - The component ID of the previous field.
00082         Description : Get the component ID of the writable field before this
00083                       one.
00084     */
00085     virtual toolbox_c _get_before() const = 0;
00086 
00087     /*
00088         Parameters  : component - The component ID of the next field.
00089         Returns     : void
00090         Description : Set the component ID of the writable field after this
00091                       one.
00092     */
00093     virtual void _set_after(toolbox_c component) = 0;
00094 
00095     /*
00096         Parameters  : void
00097         Returns     : toolbox_c - The component ID of the next field.
00098         Description : Get the component ID of the writable field after this
00099                       one.
00100     */
00101     virtual toolbox_c _get_after() const = 0;
00102 };
00103 
00104 /*
00105     Parameters  : component - The component ID of the previous field.
00106     Returns     : void
00107     Description : Set the component ID of the writable field before this
00108                   one.
00109 */
00110 inline void gadget_w_caret::set_before(toolbox_c component)
00111 {
00112     _set_before(component);
00113 }
00114 
00115 /*
00116     Parameters  : void
00117     Returns     : toolbox_c - The component ID of the previous field.
00118     Description : Get the component ID of the writable field before this
00119                   one.
00120 */
00121 inline toolbox_c gadget_w_caret::get_before() const
00122 {
00123     return _get_before();
00124 }
00125 
00126 /*
00127     Parameters  : component - The component ID of the next field.
00128     Returns     : void
00129     Description : Set the component ID of the writable field after this
00130                   one.
00131 */
00132 inline void gadget_w_caret::set_after(toolbox_c component)
00133 {
00134     _set_after(component);
00135 }
00136 
00137 /*
00138     Parameters  : void
00139     Returns     : toolbox_c - The component ID of the next field.
00140     Description : Get the component ID of the writable field after this
00141                   one.
00142 */
00143 inline toolbox_c gadget_w_caret::get_after() const
00144 {
00145     return _get_after();
00146 }
00147 
00148 #endif

Generated on Sun Jan 26 10:18:43 2025 for NBLib by doxygen 1.3.3