2 * beagle-informational-messages-request.c
4 * Copyright (C) 2006 Novell, Inc.
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
16 * The above copyright notice and this permission notice shall be included in
17 * all copies or substantial portions of the Software.
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
24 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 * DEALINGS IN THE SOFTWARE.
29 #include <sys/types.h>
30 #include <sys/socket.h>
33 #include "beagle-private.h"
34 #include "beagle-informational-messages-request.h"
35 #include "beagle-indexing-status-response.h"
42 static GObjectClass
*parent_class
= NULL
;
43 static guint signals
[LAST_SIGNAL
] = { 0 };
46 beagle_informational_messages_request_to_xml (BeagleRequest
*request
, GError
**err
)
48 GString
*data
= g_string_new (NULL
);
50 _beagle_request_append_standard_header (data
,
51 "InformationalMessagesRequest");
53 _beagle_request_append_standard_footer (data
);
59 beagle_informational_messages_request_response (BeagleRequest
*request
, BeagleResponse
*response
)
61 if (BEAGLE_IS_INDEXING_STATUS_RESPONSE (response
))
62 g_signal_emit (request
, signals
[INDEXING_STATUS
], 0, response
);
65 G_DEFINE_TYPE (BeagleInformationalMessagesRequest
, beagle_informational_messages_request
, BEAGLE_TYPE_REQUEST
)
68 beagle_informational_messages_request_class_init (BeagleInformationalMessagesRequestClass
*klass
)
70 GObjectClass
*obj_class
= G_OBJECT_CLASS (klass
);
71 BeagleRequestClass
*request_class
= BEAGLE_REQUEST_CLASS (klass
);
73 parent_class
= g_type_class_peek_parent (klass
);
75 request_class
->to_xml
= beagle_informational_messages_request_to_xml
;
76 request_class
->response
= beagle_informational_messages_request_response
;
78 signals
[INDEXING_STATUS
] =
79 g_signal_new ("indexing_status",
80 G_TYPE_FROM_CLASS (klass
),
82 G_STRUCT_OFFSET (BeagleInformationalMessagesRequestClass
, indexing_status
),
84 g_cclosure_marshal_VOID__OBJECT
,
86 BEAGLE_TYPE_INDEXING_STATUS_RESPONSE
);
88 _beagle_request_class_set_response_types (request_class
,
89 "IndexingStatusResponse",
90 BEAGLE_TYPE_INDEXING_STATUS_RESPONSE
,
95 beagle_informational_messages_request_init (BeagleInformationalMessagesRequest
*informational_messages_request
)
100 * beagle_informational_messages_request_new:
102 * Creates a new #BeagleInformationalMessagesRequest message. You will need to
103 * connect to the signals on this message for it to be useful.
105 * Return value: a newly created #BeagleInformationalMessagesRequest.
107 BeagleInformationalMessagesRequest
*
108 beagle_informational_messages_request_new (void)
110 return g_object_new (BEAGLE_TYPE_INFORMATIONAL_MESSAGES_REQUEST
, 0);