* revert '43157 as the files are actually needed. I still don't understand how I managed to build everything without them ...

* Move the files shared between server and preflet to the server folder.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43159 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Adrien Destugues
2011-11-03 12:49:18 +00:00
parent 192c6f9689
commit e9834f35e7
7 changed files with 522 additions and 0 deletions
+52
View File
@@ -0,0 +1,52 @@
/*
* Copyright 2010, Haiku, Inc. All Rights Reserved.
* Copyright 2008-2009, Pier Luigi Fiorini. All Rights Reserved.
* Copyright 2004-2008, Michael Davidson. All Rights Reserved.
* Copyright 2004-2007, Mikael Eiman. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _APP_USAGE_H
#define _APP_USAGE_H
#include <map>
#include <Entry.h>
#include <Flattenable.h>
#include <Notification.h>
#include <Roster.h>
#include <String.h>
class BMessage;
class NotificationReceived;
typedef std::map<BString, NotificationReceived*> notification_t;
class AppUsage : public BFlattenable {
public:
AppUsage();
AppUsage(const char* name,
bool allow = true);
~AppUsage();
virtual bool AllowsTypeCode(type_code code) const;
virtual status_t Flatten(void* buffer, ssize_t numBytes) const;
virtual ssize_t FlattenedSize() const;
virtual bool IsFixedSize() const;
virtual type_code TypeCode() const;
virtual status_t Unflatten(type_code code, const void* buffer,
ssize_t numBytes);
const char* Name();
bool Allowed(const char* title, notification_type type);
bool Allowed();
NotificationReceived* NotificationAt(int32 index);
int32 Notifications();
void AddNotification(NotificationReceived* notification);
private:
BString fName;
bool fAllow;
notification_t fNotifications;
};
#endif // _APP_USAGE_H
@@ -0,0 +1,46 @@
/*
* Copyright 2010, Haiku, Inc. All Rights Reserved.
* Copyright 2008-2009, Pier Luigi Fiorini. All Rights Reserved.
* Copyright 2004-2008, Michael Davidson. All Rights Reserved.
* Copyright 2004-2007, Mikael Eiman. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _NOTIFICATION_RECEIVED_H
#define _NOTIFICATION_RECEIVED_H
#include <Flattenable.h>
#include <Roster.h>
#include <String.h>
class NotificationReceived : public BFlattenable {
public:
NotificationReceived();
NotificationReceived(const char* title, notification_type type,
bool enabled = true);
~NotificationReceived();
virtual bool AllowsTypeCode(type_code code) const;
virtual status_t Flatten(void *buffer, ssize_t numBytes) const;
virtual ssize_t FlattenedSize() const;
virtual bool IsFixedSize() const;
virtual type_code TypeCode() const;
virtual status_t Unflatten(type_code code, const void *buffer,
ssize_t numBytes);
const char* Title();
notification_type Type();
void SetType(notification_type type);
time_t LastReceived();
bool Allowed();
void SetTimeStamp(time_t time);
void UpdateTimeStamp();
private:
BString fTitle;
notification_type fType;
bool fEnabled;
time_t fLastReceived;
};
#endif // _NOTIFICATION_RECEIVED_H
@@ -0,0 +1,38 @@
/*
* Copyright 2010, Haiku, Inc. All Rights Reserved.
* Distributed under the terms of the MIT License.
*/
#ifndef _NOTIFICATIONS_H
#define _NOTIFICATIONS_H
#include <Mime.h>
#define kNotificationServerSignature "application/x-vnd.Haiku-notification_server"
// Messages
const uint32 kNotificationMessage = 'nssm';
// Settings constants
extern const char* kSettingsDirectory;
extern const char* kFiltersSettings;
extern const char* kGeneralSettings;
extern const char* kDisplaySettings;
// General settings
extern const char* kAutoStartName;
extern const char* kTimeoutName;
// General default settings
const float kDefaultAutoStart = false;
const int32 kDefaultTimeout = 10;
// Display settings
extern const char* kWidthName;
extern const char* kIconSizeName;
extern const char* kLayoutName;
// Display default settings
const float kDefaultWidth = 300.0f;
const icon_size kDefaultIconSize = B_LARGE_ICON;
#endif // _NOTIFICATIONS_H