You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
88 lines
2.2 KiB
88 lines
2.2 KiB
15 years ago
|
/**
|
||
|
* Copyright (c) 2000- Dawit Alemayehu <adawit@kde.org>
|
||
|
*
|
||
|
* This program is free software; you can redistribute it and/or modify
|
||
|
* it under the terms of the GNU General Public License as published by
|
||
|
* the Free Software Foundation; either version 2 of the License, or
|
||
|
* (at your option) any later version.
|
||
|
*
|
||
|
* This program is distributed in the hope that it will be useful,
|
||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
|
* GNU General Public License for more details.
|
||
|
*
|
||
|
* You should have received a copy of the GNU General Public License
|
||
|
* along with this program; if not, write to the Free Software
|
||
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||
|
*/
|
||
|
|
||
|
#ifndef _POLICYDLG_H
|
||
|
#define _POLICYDLG_H
|
||
|
|
||
15 years ago
|
#include <tqstring.h>
|
||
15 years ago
|
|
||
|
#include <kdialogbase.h>
|
||
|
|
||
|
|
||
15 years ago
|
class TQPushButton;
|
||
15 years ago
|
class PolicyDlgUI;
|
||
|
|
||
|
class KCookieAdvice
|
||
|
{
|
||
|
public:
|
||
|
enum Value {Dunno=0, Accept, Reject, Ask};
|
||
|
|
||
|
static const char * adviceToStr (const int& advice)
|
||
|
{
|
||
|
switch (advice)
|
||
|
{
|
||
|
case KCookieAdvice::Accept:
|
||
|
return I18N_NOOP("Accept");
|
||
|
case KCookieAdvice::Reject:
|
||
|
return I18N_NOOP("Reject");
|
||
|
case KCookieAdvice::Ask:
|
||
|
return I18N_NOOP("Ask");
|
||
|
default:
|
||
|
return I18N_NOOP("Dunno");
|
||
|
}
|
||
|
}
|
||
|
|
||
15 years ago
|
static KCookieAdvice::Value strToAdvice (const TQString& advice)
|
||
15 years ago
|
{
|
||
|
if (advice.isEmpty())
|
||
|
return KCookieAdvice::Dunno;
|
||
|
|
||
13 years ago
|
if (advice.find (TQString::fromLatin1("accept"), 0, false) == 0)
|
||
15 years ago
|
return KCookieAdvice::Accept;
|
||
13 years ago
|
else if (advice.find (TQString::fromLatin1("reject"), 0, false) == 0)
|
||
15 years ago
|
return KCookieAdvice::Reject;
|
||
13 years ago
|
else if (advice.find (TQString::fromLatin1("ask"), 0, false) == 0)
|
||
15 years ago
|
return KCookieAdvice::Ask;
|
||
|
|
||
|
return KCookieAdvice::Dunno;
|
||
|
}
|
||
|
};
|
||
|
|
||
|
class PolicyDlg : public KDialogBase
|
||
|
{
|
||
|
Q_OBJECT
|
||
|
|
||
|
public:
|
||
15 years ago
|
PolicyDlg (const TQString& caption, TQWidget *parent = 0,
|
||
15 years ago
|
const char *name = 0);
|
||
|
~PolicyDlg (){};
|
||
|
|
||
|
int advice() const;
|
||
15 years ago
|
TQString domain() const;
|
||
15 years ago
|
|
||
15 years ago
|
void setEnableHostEdit( bool, const TQString& host = TQString::null );
|
||
15 years ago
|
void setPolicy (int policy);
|
||
|
|
||
|
protected slots:
|
||
15 years ago
|
void slotTextChanged( const TQString& );
|
||
15 years ago
|
|
||
|
private:
|
||
|
PolicyDlgUI* m_dlgUI;
|
||
|
};
|
||
|
#endif
|