source: trunk/dsa_messenger/client-user_list_models.ads

Last change on this file was 8, checked in by vadim.godunko, 12 years ago

Add list of users.

File size: 1.5 KB
Line 
1private with Ada.Containers.Vectors;
2
3with Qt4.Abstract_List_Models;
4private with Qt4.Abstract_List_Models.Directors;
5private with Qt4.Model_Indices;
6with Qt4.Objects;
7with Qt4.Strings;
8private with Qt4.Variants;
9
10package Client.User_List_Models is
11
12 type User_List_Model is
13 limited new Qt4.Abstract_List_Models.Q_Abstract_List_Model with private;
14
15 type User_List_Model_Access is access all User_List_Model'Class;
16
17 procedure Insert
18 (Self : not null access User_List_Model'Class;
19 Name : Qt4.Strings.Q_String);
20
21 procedure Remove
22 (Self : not null access User_List_Model'Class;
23 Name : Qt4.Strings.Q_String);
24
25 package Constructors is
26
27 function Create (Parent : access Qt4.Objects.Q_Object'Class := null)
28 return not null User_List_Model_Access;
29
30 end Constructors;
31
32private
33
34 package Q_String_Vectors is
35 new Ada.Containers.Vectors
36 (Natural, Qt4.Strings.Q_String, Qt4.Strings."=");
37
38 type User_List_Model is
39 limited new
40 Qt4.Abstract_List_Models.Directors.Q_Abstract_List_Model_Director
41 with record
42 Users : Q_String_Vectors.Vector;
43 end record;
44
45 overriding function Data
46 (Self : not null access User_List_Model;
47 Index : Qt4.Model_Indices.Q_Model_Index;
48 Role : Qt4.Item_Data_Role := Qt4.Display_Role)
49 return Qt4.Variants.Q_Variant;
50
51 overriding function Row_Count
52 (Self : not null access constant User_List_Model;
53 Parent : Qt4.Model_Indices.Q_Model_Index
54 := Qt4.Model_Indices.Create) return Qt4.Q_Integer;
55
56end Client.User_List_Models;
Note: See TracBrowser for help on using the repository browser.