61 lines
1.5 KiB
C++
61 lines
1.5 KiB
C++
/*
|
|
* Copyright (c) CompanyNameMagicTag 2021-2021. All rights reserved.
|
|
* Description: SettingAdapter.h
|
|
* Author:
|
|
* Create: 2021-11-23
|
|
*/
|
|
|
|
#ifndef SETTING_ADAPTER_H
|
|
#define SETTING_ADAPTER_H
|
|
|
|
#include <list>
|
|
#include <string>
|
|
#include "components/ui_list.h"
|
|
#include "components/ui_label.h"
|
|
#include "components/ui_view_group.h"
|
|
#include "components/ui_image_view.h"
|
|
#include "components/abstract_adapter.h"
|
|
#include "wearable_log.h"
|
|
#include "UiConfig.h"
|
|
#include "SettingModel.h"
|
|
#include "SettingItemView.h"
|
|
|
|
namespace OHOS {
|
|
class SettingAdapter : public AbstractAdapter {
|
|
public:
|
|
explicit SettingAdapter();
|
|
~SettingAdapter() override;
|
|
|
|
/* *
|
|
* @brief Sets the UIView adapter data, which is a SettingItem linked list.
|
|
*
|
|
* @param data Indicates the SettingItem linked list data.
|
|
* @since 1.0
|
|
* @version 1.0
|
|
*/
|
|
void SetData(std::list<SettingItem> &data);
|
|
|
|
/* *
|
|
* @brief Obtains the <b>data</b> size of the UILabel adapter.
|
|
*
|
|
* @return Returns the <b>data</b> size of the UILabel adapter.
|
|
* @since 1.0
|
|
* @version 1.0
|
|
*/
|
|
uint16_t GetCount(void) override;
|
|
|
|
UIView *GetView(UIView *inView, int16_t index) override;
|
|
|
|
void AddListItem(const SettingItem &item);
|
|
|
|
void SetItemClickListener(UIView::OnClickListener *itemclicklistener)
|
|
{
|
|
itemClickListener = itemclicklistener;
|
|
}
|
|
private:
|
|
std::list<SettingItem> listData;
|
|
UIView::OnClickListener *itemClickListener{nullptr};
|
|
};
|
|
}
|
|
|
|
#endif |