/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dlog.h>
#include <livebox-service.h>
+#include <livebox-errno.h>
#include "debug.h"
#include "livebox-cpp.h"
dlclose(m_pHandle);
free(m_sPkgname);
delete this;
- return 0;
+ return LB_STATUS_SUCCESS;
}
int CModule::Create(const char *filename, const char *content, const char *cluster, const char *category)
return 0;
}
- return -EFAULT;
+ return LB_STATUS_ERROR_FAULT;
}
int CModule::Destroy(CLiveBoxImpl *inst)
l = dlist_find_data(m_pList, inst);
if (!l)
- return -ENOENT;
+ return LB_STATUS_ERROR_NOT_EXIST;
m_pList = dlist_remove(m_pList, l);
delete inst;
- return 0;
+ return LB_STATUS_SUCCESS;
}
CLiveBoxImpl *CModule::FindLiveBox(const char *filename)
/*
- * Copyright 2012 Samsung Electronics Co., Ltd
+ * Copyright 2013 Samsung Electronics Co., Ltd
*
* Licensed under the Flora License, Version 1.0 (the "License");
* you may not use this file except in compliance with the License.
#include <dlog.h>
#include <livebox.h>
+#include <livebox-errno.h>
#include "livebox-cpp.h"
#include "livebox-impl.h"
module = CModule::FindModule(pkgname);
if (module)
- return 0;
+ return LB_STATUS_SUCCESS;
module = CModule::Load(pkgname);
if (!module)
- return -EFAULT;
+ return LB_STATUS_ERROR_FAULT;
- return 0;
+ return LB_STATUS_SUCCESS;
}
EAPI int livebox_finalize(const char *pkgname)
module = CModule::FindModule(pkgname);
if (!module)
- return -ENOENT;
+ return LB_STATUS_ERROR_NOT_EXIST;
module->Unload();
- return 0;
+ return LB_STATUS_SUCCESS;
}
EAPI int livebox_create(const char *pkgname, const char *filename, const char *content, const char *cluster, const char *category)
module = CModule::FindModule(pkgname);
if (!module)
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
box = module->FindLiveBox(filename);
if (box)
- return -EEXIST;
+ return LB_STATUS_ERROR_NOT_EXIST;
ret = module->Create(filename, content, cluster, category);
return ret;
module = CModule::FindModule(pkgname);
if (!module)
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
box = module->FindLiveBox(filename);
if (!box)
- return -ENOENT;
+ return LB_STATUS_ERROR_NOT_EXIST;
ret = module->Destroy(box);
return ret;
module = CModule::FindModule(pkgname);
if (!module)
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
box = module->FindLiveBox(filename);
if (!box)
- return -ENOENT;
+ return LB_STATUS_ERROR_NOT_EXIST;
return box->NeedToUpdate();
}
module = CModule::FindModule(pkgname);
if (!module)
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
box = module->FindLiveBox(filename);
if (!box)
- return -ENOENT;
+ return LB_STATUS_ERROR_NOT_EXIST;
return box->NeedToDestroy();
}
module = CModule::FindModule(pkgname);
if (!module)
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
box = module->FindLiveBox(filename);
if (!box)
- return -ENOENT;
+ return LB_STATUS_ERROR_NOT_EXIST;
return box->UpdateContent();
}
module = CModule::FindModule(pkgname);
if (!module)
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
box = module->FindLiveBox(filename);
if (!box)
- return -ENOENT;
+ return LB_STATUS_ERROR_NOT_EXIST;
return box->Clicked(event, timestamp, x, y);
}
module = CModule::FindModule(pkgname);
if (!module)
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
box = module->FindLiveBox(filename);
if (!box)
- return -ENOENT;
+ return LB_STATUS_ERROR_NOT_EXIST;
return box->ContentEvent(emission, source, event_info);
}
module = CModule::FindModule(pkgname);
if (!module)
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
box = module->FindLiveBox(filename);
if (!box)
- return -ENOENT;
+ return LB_STATUS_ERROR_NOT_EXIST;
return box->Resize(type);
}
module = CModule::FindModule(pkgname);
if (!module)
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
box = module->FindLiveBox(filename);
if (!box)
- return -ENOENT;
+ return LB_STATUS_ERROR_NOT_EXIST;
return box->ChangeGroup(cluster, category);
}
module = CModule::FindModule(pkgname);
if (!module)
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
box = module->FindLiveBox(filename);
if (!box)
- return -ENOENT;
+ return LB_STATUS_ERROR_NOT_EXIST;
return box->GetInfo(w, h, priority, content, title);
}
module = CModule::FindModule(pkgname);
if (!module)
- return -EINVAL;
+ return LB_STATUS_ERROR_INVALID;
return module->NeedToCreate(cluster, category);
}