1 /*---------------------------------------------------------------------------*
2   Project:  Horizon
3   File:     ubl_Api.h
4 
5   Copyright (C)2010 Nintendo Co., Ltd.  All rights reserved.
6 
7   These coded instructions, statements, and computer programs contain
8   proprietary information of Nintendo of America Inc. and/or Nintendo
9   Company Ltd., and are protected by Federal copyright law.  They may
10   not be disclosed to third parties or copied or duplicated in any form,
11   in whole or in part, without the prior written consent of Nintendo.
12 
13   $Rev: 17231 $
14  *---------------------------------------------------------------------------*/
15 
16 #ifndef UBL_API_H_
17 #define UBL_API_H_
18 
19 #include<nn/fs.h>
20 #include<nn/fnd.h>
21 #include<nn/Result.h>
22 
23 namespace nn {
24 namespace ubl {
25 
26 /*=======================================================================*
27     関数プロトタイプ宣言
28  *=======================================================================*/
29 
30 /*!--------------------------------------------------------------------------*
31   @brief        UBLライブラリを初期化処理を行います
32                 ライブラリ利用前に一度呼び出す必要があります
33 
34   @return       処理の結果が返ってきます
35  *---------------------------------------------------------------------------*/
36 nn::Result Initialize( void );
37 
38 /*!--------------------------------------------------------------------------*
39   @brief        UBLライブラリを終了します
40  *---------------------------------------------------------------------------*/
41 void Finalize( void );
42 
43 /*!--------------------------------------------------------------------------*
44   @brief        ローカルブラックリストをクリアーした後、SDカードに書き出します
45 
46   @return       クリアー処理に対する処理の結果が返ります
47  *---------------------------------------------------------------------------*/
48 nn::Result Clear( void );
49 
50 /*!--------------------------------------------------------------------------*
51   @brief        指定IDがブラックリストに存在するか調べます
52 
53                 現在、ローカルブラックリストのみ検索します。
54                 つまりタイトルIDとUGCデータIDは無視されます。
55                 グローバルへの対応は将来行われる予定です。
56 
57   @param[in]    authorId 検索する作者ID
58   @param[in]    titleId  検索するタイトルID
59   @param[in]    dataId   検索するUGCデータID
60 
61   @return       指定した要素が合致したならtrue、合致しなければfalse
62  *---------------------------------------------------------------------------*/
63 bool IsExist( u64 authorId , u32 titleId , u64 dataId);
64 
65 /*!--------------------------------------------------------------------------*
66   @brief        ローカルブラックリストに登録されている作者の総数を返します
67 
68   @return       ローカルブラックリストに登録されている作者の総数
69  *---------------------------------------------------------------------------*/
70 u32 GetTotalLocalUser( void );
71 
72 /*!--------------------------------------------------------------------------*
73   @brief        グローバル作者ブラックリストに登録されている作者の総数を返します
74 
75   @return       グローバル作者ブラックリストに登録されている作者の総数
76  *---------------------------------------------------------------------------*/
77 u32 GetTotalGlobalUser( void );
78 
79 /*!--------------------------------------------------------------------------*
80   @brief        グローバルデータブラックリストに登録されているデータの総数を返します
81 
82   @return       グローバルデータブラックリストに登録されているデータの総数
83  *---------------------------------------------------------------------------*/
84 u32 GetTotalGlobalData( void );
85 
86 /*!--------------------------------------------------------------------------*
87   @brief        CTR本体のユニークIDを返します
88 
89   @return       CTR本体のユニークID
90  *---------------------------------------------------------------------------*/
91 u64 GetUserId( void );
92 
93 /*!--------------------------------------------------------------------------*
94   @brief        ユーザー名を取得します
95 
96   @param[out]   name 取得したユーザ名を格納するメモリへのポインタ
97 
98   @return       ユーザー名にNGワードが含まれている場合にはtrue
99  *---------------------------------------------------------------------------*/
100 bool GetUserName( wchar_t *name );
101 
102 /*!--------------------------------------------------------------------------*
103   @brief        64ビット長のハッシュデータを取得します
104 
105   @param[in]    inputBuffer 入力データへのポインタ
106   @param[in]    inputSize   入力データのサイズ
107 
108   @return       64ビットのハッシュデータ
109  *---------------------------------------------------------------------------*/
110 u64 GetHashValue( const void *inputBuffer , size_t inputSize);
111 
112 /*!--------------------------------------------------------------------------*
113   @brief        指定されたIDと日時をローカルブラックリストに登録し、SDカードに書き出します
114 
115   @param[in]    id 登録する作者ID
116   @param[in]    dt 登録日時
117 
118   @return       登録処理に対する処理の結果が返ります
119  *---------------------------------------------------------------------------*/
120 nn::Result Entry( u64 id, nn::fnd::DateTime *dt );
121 
122 } // end of namespace ubl
123 } // end of namespace nn
124 
125 #endif /* UBL_API_H_ */
126