merge the formfield patch from ooo-build
[ooovba.git] / svtools / inc / regoptions.hxx
blobf604f736e3c8e2b571ebeebcb594d5ba6aaf74e4
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: regoptions.hxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef SVTOOLS_REGOPTIONS_HXX
32 #define SVTOOLS_REGOPTIONS_HXX
34 #include "svtools/svldllapi.h"
35 #include <tools/string.hxx>
37 //........................................................................
38 namespace svt
40 //........................................................................
42 //====================================================================
43 //= RegOptions
44 //====================================================================
45 class RegOptionsImpl;
46 /** encapsulates access to the configuration settings for registering the product
48 class SVL_DLLPUBLIC RegOptions
50 private:
51 RegOptionsImpl* m_pImpl;
53 // the impl class is constructed upon need only (as this is expensive)
54 SVL_DLLPRIVATE void ensureImpl( );
56 public:
57 RegOptions( );
58 ~RegOptions( );
60 // retrieves the URL which should be used for online registration
61 String getRegistrationURL( ) const;
63 // checks if the menu item which can be used to trigger the online registration should be available
64 sal_Bool allowMenu( ) const;
66 enum DialogPermission
67 { // the registration dialog shall be executed ....
68 dpDisabled, // ... never - it has been disabled
69 dpNotThisSession, // ... later - no statement when, but _not now_
70 dpRemindLater, // ... later at a reminder date
71 dpThisSession // ... during this session
74 /** checks if the registration dialog is allowed
75 <p>A return value of <TRUE/> does not mean that during this session, the dialog is allowed to
76 be executed. It simply means executing it is allowed <em>in general</em></p>
78 DialogPermission getDialogPermission( ) const;
80 /** claims that the current session is done with respect to the registration dialog.
82 <p>This is not to be called if <method>getDialogPermission</method> returned dpDisabled previously<p>
83 <p>The behaviour changes as follows:
84 <ul>
85 <li>any subsequent calls to <method>getDialogPermission</method> will return dpNotThisSession, given
86 that it previously returned dpNotThisSession</li>
87 <li>any subsequent calls to <method>getDialogPermission</method> will return dpDisabled, given
88 that it previously returned dpThisSession</li>
89 <li>an internal (persistent) session counter is updated, so that during the next session,
90 <method>getDialogPermission</method> <em>may</em> return dpThisSession</li>
91 </ul></p>
93 void markSessionDone( );
95 /** activates the reminder
97 <p>If this method is called, the reminder for the dialog will be activated.
98 This means that during the next <arg>_nDaysFromNow</arg>-1 days,
99 <method>getDialogPermission</method> will return dpRemindLater</p>,
100 at the <arg>_nDaysFromNow</arg>th day from today onwards it will
101 return dpThisSession.</p>
103 <p>It is not allowed to call this method if the dialog is currently disabled.</p>
105 <p>If the current session has not been marked as done already
106 (i.e., <method>markSessionDone</method> has not been called, yet), this is
107 done implicitly when you call <method>activateReminder</method>.</p>
109 void activateReminder( sal_Int32 _nDaysFromNow );
111 /** removes the reminder
113 <p>If this method is called, the reminder for the dialog will be removed.
115 void removeReminder();
117 /** checks if the reminder date has come
119 <p>Returns <true/> if the current date is greater or equal the reminder date.
121 bool hasReminderDateCome() const;
124 //........................................................................
125 } // namespace svt
126 //........................................................................
128 #endif // SVTOOLS_REGOPTIONS_HXX