haiku/src/apps/webpositive/support/SettingsMessage.h

106 lines
3.1 KiB
C
Raw Normal View History

/*
* Copyright 2008-2010 Stephan Aßmus <superstippi@gmx.de>.
* 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
#include <FindDirectory.h>
#include <Font.h>
#include <List.h>
#include <Locker.h>
#include <Message.h>
#include <Path.h>
class BMessenger;
class BString;
enum {
SETTINGS_VALUE_CHANGED = '_svc'
};
class SettingsMessage : public BMessage, public BLocker {
public:
SettingsMessage(directory_which directory,
const char* filename);
virtual ~SettingsMessage();
status_t InitCheck() const;
status_t Load();
status_t Save() const;
bool AddListener(const BMessenger& listener);
void RemoveListener(const BMessenger& listener);
status_t SetValue(const char* name, bool value);
status_t SetValue(const char* name, int8 value);
status_t SetValue(const char* name, int16 value);
status_t SetValue(const char* name, int32 value);
status_t SetValue(const char* name, uint32 value);
status_t SetValue(const char* name, int64 value);
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);
status_t SetValue(const char *name,
const BPoint& value);
status_t SetValue(const char* name, const BRect& value);
status_t SetValue(const char* name,
const entry_ref& value);
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);
status_t SetValue(const char* name,
const BFlattenable* value);
status_t SetValue(const char* name,
const BFont& value);
bool GetValue(const char* name,
bool defaultValue) const;
int8 GetValue(const char* name,
int8 defaultValue) const;
int16 GetValue(const char* name,
int16 defaultValue) const;
int32 GetValue(const char* name,
int32 defaultValue) const;
uint32 GetValue(const char* name,
uint32 defaultValue) const;
int64 GetValue(const char* name,
int64 defaultValue) const;
float GetValue(const char* name,
float defaultValue) const;
double GetValue(const char* name,
double defaultValue) const;
const char* GetValue(const char* name,
const char* defaultValue) const;
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;
BFont GetValue(const char* name,
const BFont& defaultValue) const;
private:
void _NotifyValueChanged(const char* name) const;
private:
BPath fPath;
status_t fStatus;
BList fListeners;
};
#endif // SETTINGS_MESSAGE_H