2010-03-03 14:08:50 +03:00
|
|
|
/*
|
2010-03-22 21:04:31 +03:00
|
|
|
* Copyright 2008-2010 Stephan Aßmus <superstippi@gmx.de>.
|
2010-03-03 14:08:50 +03:00
|
|
|
* Copyright 1998 Eric Shepherd.
|
|
|
|
* All rights reserved. Distributed under the terms of the Be Sample Code
|
|
|
|
* license.
|
|
|
|
*/
|
|
|
|
#ifndef SETTINGS_MESSAGE_H
|
|
|
|
#define SETTINGS_MESSAGE_H
|
|
|
|
|
2010-03-22 21:04:31 +03:00
|
|
|
|
2010-03-03 14:08:50 +03:00
|
|
|
#include <FindDirectory.h>
|
2010-03-04 21:17:24 +03:00
|
|
|
#include <Font.h>
|
2010-03-22 21:04:31 +03:00
|
|
|
#include <List.h>
|
2010-03-23 03:02:05 +03:00
|
|
|
#include <Locker.h>
|
2010-03-03 14:08:50 +03:00
|
|
|
#include <Message.h>
|
|
|
|
#include <Path.h>
|
|
|
|
|
2010-03-22 21:04:31 +03:00
|
|
|
class BMessenger;
|
2010-03-03 14:08:50 +03:00
|
|
|
class BString;
|
|
|
|
|
2010-03-22 21:04:31 +03:00
|
|
|
|
|
|
|
enum {
|
2010-03-23 03:02:05 +03:00
|
|
|
SETTINGS_VALUE_CHANGED = '_svc'
|
2010-03-22 21:04:31 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2010-03-23 03:02:05 +03:00
|
|
|
class SettingsMessage : public BMessage, public BLocker {
|
2010-03-03 14:08:50 +03:00
|
|
|
public:
|
|
|
|
SettingsMessage(directory_which directory,
|
|
|
|
const char* filename);
|
|
|
|
virtual ~SettingsMessage();
|
2010-04-07 03:50:17 +04:00
|
|
|
|
2010-03-03 14:08:50 +03:00
|
|
|
|
|
|
|
status_t InitCheck() const;
|
|
|
|
status_t Load();
|
|
|
|
status_t Save() const;
|
|
|
|
|
2010-03-22 21:04:31 +03:00
|
|
|
bool AddListener(const BMessenger& listener);
|
|
|
|
void RemoveListener(const BMessenger& listener);
|
|
|
|
|
2010-03-03 14:08:50 +03:00
|
|
|
status_t SetValue(const char* name, bool value);
|
|
|
|
status_t SetValue(const char* name, int8 value);
|
|
|
|
status_t SetValue(const char* name, int16 value);
|
2021-04-25 15:32:56 +03:00
|
|
|
status_t SetValue(const char* name, uint16 value);
|
2010-03-03 14:08:50 +03:00
|
|
|
status_t SetValue(const char* name, int32 value);
|
|
|
|
status_t SetValue(const char* name, uint32 value);
|
|
|
|
status_t SetValue(const char* name, int64 value);
|
2021-04-25 15:32:56 +03:00
|
|
|
status_t SetValue(const char* name, uint64 value);
|
2010-03-03 14:08:50 +03:00
|
|
|
status_t SetValue(const char* name, float value);
|
|
|
|
status_t SetValue(const char* name, double value);
|
|
|
|
status_t SetValue(const char* name,
|
|
|
|
const char* value);
|
|
|
|
status_t SetValue(const char* name,
|
|
|
|
const BString& value);
|
2010-03-23 03:02:05 +03:00
|
|
|
status_t SetValue(const char *name,
|
|
|
|
const BPoint& value);
|
2010-03-03 14:08:50 +03:00
|
|
|
status_t SetValue(const char* name, const BRect& value);
|
2010-03-23 03:02:05 +03:00
|
|
|
status_t SetValue(const char* name,
|
|
|
|
const entry_ref& value);
|
2010-03-03 14:08:50 +03:00
|
|
|
status_t SetValue(const char* name,
|
* Added a class CookieJarClient to WebCore's CookieJar.h which provides the
same functionality as the global methods for managing cookies. This is only
enabled for the Haiku platform. Since the global cookie methods get a Document
pointer, I envision, the CookieJarClient could eventually be a member of
Document instances. It would then be passed upon WebCore::Page creation.
Still waiting on feedback from other WebKit developers on this one. This change
is more elegant than what the Qt port does, which is to use WebKit classes in
WebCore (layering violation). Right now, a single global instance of a
CookieJarClient can be assigned.
* Implemented CookieJarClientHaiku which uses a BNetworkCookieJar to forward
the requests. Eventually, the behaviour could be browser specific.
* Added all the necessary wiring to BrowserApplication to make the cookie jar
persistent.
* TODO: Actually parse cookies and handle at least the expiration date, but
other stuff like matching the domain of the cookie and the URL and "HTTP-only"
cookies seems important as well.
Even though I have confirmed that cookies are stored and restored correctly,
and also retrieved via the global cookie methods, I can see no change in browser
behaviour. For example enabling "Stay signed in" on googlemail.com does not work
in WebPositive, although BeZillaBrowser automatically logs in in a new session
when surfing to googlemail.com. No idea if this is even implemented with
cookies, although it seems like it should be.
git-svn-id: http://svn.haiku-os.org/webpositive/webkit/trunk@303 94f232f2-1747-11df-bad5-a5bfde151594
2010-03-09 14:49:34 +03:00
|
|
|
const BMessage& value);
|
2010-03-03 14:08:50 +03:00
|
|
|
status_t SetValue(const char* name,
|
|
|
|
const BFlattenable* value);
|
2010-03-04 21:17:24 +03:00
|
|
|
status_t SetValue(const char* name,
|
|
|
|
const BFont& value);
|
2021-04-25 15:03:35 +03:00
|
|
|
status_t SetValue(const char* name, type_code type,
|
|
|
|
const void* data, ssize_t numBytes);
|
2010-03-03 14:08:50 +03:00
|
|
|
|
|
|
|
bool GetValue(const char* name,
|
|
|
|
bool defaultValue) const;
|
|
|
|
int8 GetValue(const char* name,
|
|
|
|
int8 defaultValue) const;
|
|
|
|
int16 GetValue(const char* name,
|
|
|
|
int16 defaultValue) const;
|
2021-04-25 15:32:56 +03:00
|
|
|
uint16 GetValue(const char* name,
|
|
|
|
uint16 defaultValue) const;
|
2010-03-03 14:08:50 +03:00
|
|
|
int32 GetValue(const char* name,
|
|
|
|
int32 defaultValue) const;
|
|
|
|
uint32 GetValue(const char* name,
|
|
|
|
uint32 defaultValue) const;
|
|
|
|
int64 GetValue(const char* name,
|
|
|
|
int64 defaultValue) const;
|
2021-04-25 15:32:56 +03:00
|
|
|
uint64 GetValue(const char* name,
|
|
|
|
uint64 defaultValue) const;
|
2010-03-03 14:08:50 +03:00
|
|
|
float GetValue(const char* name,
|
|
|
|
float defaultValue) const;
|
|
|
|
double GetValue(const char* name,
|
|
|
|
double defaultValue) const;
|
2010-03-23 03:02:05 +03:00
|
|
|
const char* GetValue(const char* name,
|
|
|
|
const char* defaultValue) const;
|
2010-03-03 14:08:50 +03:00
|
|
|
BString GetValue(const char* name,
|
|
|
|
const BString& defaultValue) const;
|
|
|
|
BPoint GetValue(const char *name,
|
|
|
|
BPoint defaultValue) const;
|
|
|
|
BRect GetValue(const char* name,
|
|
|
|
BRect defaultValue) const;
|
|
|
|
entry_ref GetValue(const char* name,
|
|
|
|
const entry_ref& defaultValue) const;
|
|
|
|
BMessage GetValue(const char* name,
|
|
|
|
const BMessage& defaultValue) const;
|
2010-03-04 21:17:24 +03:00
|
|
|
BFont GetValue(const char* name,
|
|
|
|
const BFont& defaultValue) const;
|
2021-04-25 15:03:35 +03:00
|
|
|
void* GetValue(const char* name, type_code type,
|
|
|
|
ssize_t numBytes,
|
|
|
|
const void** defaultValue)const;
|
2010-03-03 14:08:50 +03:00
|
|
|
|
2010-03-22 21:04:31 +03:00
|
|
|
private:
|
|
|
|
void _NotifyValueChanged(const char* name) const;
|
|
|
|
|
2010-03-03 14:08:50 +03:00
|
|
|
private:
|
|
|
|
BPath fPath;
|
|
|
|
status_t fStatus;
|
2010-03-22 21:04:31 +03:00
|
|
|
BList fListeners;
|
2010-03-03 14:08:50 +03:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // SETTINGS_MESSAGE_H
|