2008-10-01 08:28:35 +04:00
|
|
|
/*
|
|
|
|
* Copyright 2007-2008, François Revol, <revol@free.fr>. All rights reserved.
|
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
|
2008-02-01 06:16:18 +03:00
|
|
|
/*
|
|
|
|
* ThemeImporter class
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <Debug.h>
|
|
|
|
#include <Directory.h>
|
|
|
|
#include <Message.h>
|
|
|
|
#include <String.h>
|
|
|
|
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <string.h>
|
|
|
|
#include <malloc.h>
|
|
|
|
|
|
|
|
#include "ThemeImporter.h"
|
|
|
|
|
|
|
|
|
|
|
|
#define DEBUG_TI
|
|
|
|
#ifdef DEBUG_TI
|
|
|
|
#define FENTRY PRINT(("ThemesImporter[%s]::%s()\n", Name(), __FUNCTION__))
|
|
|
|
#else
|
|
|
|
#define FENTRY
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
ThemeImporter::ThemeImporter(const char *name)
|
|
|
|
:fName(name),
|
|
|
|
fFlags(0L)
|
|
|
|
{
|
|
|
|
FENTRY;
|
|
|
|
fSettings.MakeEmpty();
|
|
|
|
}
|
|
|
|
|
2008-10-01 07:52:08 +04:00
|
|
|
|
2008-02-01 06:16:18 +03:00
|
|
|
ThemeImporter::~ThemeImporter()
|
|
|
|
{
|
|
|
|
FENTRY;
|
|
|
|
}
|
|
|
|
|
2008-10-01 07:52:08 +04:00
|
|
|
|
|
|
|
const char *
|
|
|
|
ThemeImporter::Name()
|
2008-02-01 06:16:18 +03:00
|
|
|
{
|
|
|
|
return fName.String();
|
|
|
|
}
|
|
|
|
|
2008-10-01 07:52:08 +04:00
|
|
|
|
|
|
|
const char *
|
|
|
|
ThemeImporter::Description()
|
2008-02-01 06:16:18 +03:00
|
|
|
{
|
|
|
|
FENTRY;
|
|
|
|
return "No description yet.";
|
|
|
|
}
|
|
|
|
|
2008-10-01 07:52:08 +04:00
|
|
|
|
|
|
|
status_t
|
|
|
|
ThemeImporter::LoadSettings(BMessage &settings)
|
2008-02-01 06:16:18 +03:00
|
|
|
{
|
|
|
|
FENTRY;
|
|
|
|
uint32 flags;
|
|
|
|
fSettings = settings;
|
|
|
|
if (fSettings.FindInt32("ta:flags", (int32 *)&flags) >= B_OK)
|
|
|
|
fFlags = flags;
|
|
|
|
return B_OK;
|
|
|
|
}
|
|
|
|
|
2008-10-01 07:52:08 +04:00
|
|
|
|
|
|
|
status_t
|
|
|
|
ThemeImporter::SaveSettings(BMessage &settings)
|
2008-02-01 06:16:18 +03:00
|
|
|
{
|
|
|
|
FENTRY;
|
|
|
|
status_t err;
|
|
|
|
err = fSettings.ReplaceInt32("ta:flags", fFlags);
|
|
|
|
settings = fSettings;
|
|
|
|
return err;
|
|
|
|
}
|
|
|
|
|
2008-10-01 07:52:08 +04:00
|
|
|
|
|
|
|
void
|
|
|
|
ThemeImporter::SetFlags(uint32 flags)
|
2008-02-01 06:16:18 +03:00
|
|
|
{
|
|
|
|
fFlags = flags;
|
|
|
|
}
|
|
|
|
|
2008-10-01 07:52:08 +04:00
|
|
|
|
|
|
|
uint32
|
|
|
|
ThemeImporter::Flags()
|
2008-02-01 06:16:18 +03:00
|
|
|
{
|
|
|
|
return fFlags;
|
|
|
|
}
|
|
|
|
|
2008-10-01 07:52:08 +04:00
|
|
|
|
|
|
|
status_t
|
|
|
|
ThemeImporter::FetchThemes()
|
2008-02-01 06:16:18 +03:00
|
|
|
{
|
|
|
|
FENTRY;
|
|
|
|
return B_OK;
|
|
|
|
}
|
|
|
|
|
2008-10-01 07:52:08 +04:00
|
|
|
|
|
|
|
status_t
|
|
|
|
ThemeImporter::ImportNextTheme(BMessage **theme)
|
2008-02-01 06:16:18 +03:00
|
|
|
{
|
|
|
|
FENTRY;
|
|
|
|
return ENOENT;
|
|
|
|
}
|
|
|
|
|
2008-10-01 07:52:08 +04:00
|
|
|
|
|
|
|
status_t
|
|
|
|
ThemeImporter::EndImports()
|
2008-02-01 06:16:18 +03:00
|
|
|
{
|
|
|
|
FENTRY;
|
|
|
|
return B_OK;
|
|
|
|
}
|
|
|
|
|