| 107 | |
| 108 | |
| 109 | void RequiresQueue::QueueSetup(DBus::Object::Base *object_ptr, |
| 110 | const std::string &meth_qchktypegr, |
| 111 | const std::string &meth_queuefetch, |
| 112 | const std::string &meth_queuechk, |
| 113 | const std::string &meth_provideresp) |
| 114 | { |
| 115 | if (!object_ptr) |
| 116 | { |
| 117 | throw DBus::Exception("RequiresQueue", "DBus::Object::Base pointer is invalid"); |
| 118 | } |
| 119 | |
| 120 | auto chktype_gr = object_ptr->AddMethod(meth_qchktypegr, |
| 121 | [this](DBus::Object::Method::Arguments::Ptr args) |
| 122 | { |
| 123 | auto r = this->QueueCheckTypeGroupGVariant(); |
| 124 | args->SetMethodReturn(r); |
| 125 | }); |
| 126 | chktype_gr->AddOutput("type_group_list", "a(uu)"); |
| 127 | |
| 128 | auto queue_fetch = object_ptr->AddMethod(meth_queuefetch, |
| 129 | [this](DBus::Object::Method::Arguments::Ptr args) |
| 130 | { |
| 131 | auto r = this->QueueFetchGVariant(args->GetMethodParameters()); |
| 132 | args->SetMethodReturn(r); |
| 133 | }); |
| 134 | queue_fetch->AddInput("type", glib2::DataType::DBus<ClientAttentionType>()); |
| 135 | queue_fetch->AddInput("group", glib2::DataType::DBus<ClientAttentionGroup>()); |
| 136 | queue_fetch->AddInput("id", glib2::DataType::DBus<uint32_t>()); |
| 137 | queue_fetch->AddOutput("type", glib2::DataType::DBus<uint32_t>()); |
| 138 | queue_fetch->AddOutput("group", glib2::DataType::DBus<uint32_t>()); |
| 139 | queue_fetch->AddOutput("id", glib2::DataType::DBus<uint32_t>()); |
| 140 | queue_fetch->AddOutput("name", glib2::DataType::DBus<std::string>()); |
| 141 | queue_fetch->AddOutput("descripiton", glib2::DataType::DBus<std::string>()); |
| 142 | queue_fetch->AddOutput("hidden_input", glib2::DataType::DBus<bool>()); |
| 143 | |
| 144 | auto queue_chk = object_ptr->AddMethod(meth_queuechk, |
| 145 | [this](DBus::Object::Method::Arguments::Ptr args) |
| 146 | { |
| 147 | auto r = this->QueueCheckGVariant(args->GetMethodParameters()); |
| 148 | args->SetMethodReturn(r); |
| 149 | }); |
| 150 | queue_chk->AddInput("type", glib2::DataType::DBus<ClientAttentionType>()); |
| 151 | queue_chk->AddInput("group", glib2::DataType::DBus<ClientAttentionGroup>()); |
| 152 | queue_chk->AddOutput("indexes", "au"); |
| 153 | |
| 154 | |
| 155 | auto prov_resp = object_ptr->AddMethod(meth_provideresp, |
| 156 | [this](DBus::Object::Method::Arguments::Ptr args) |
| 157 | { |
| 158 | this->UpdateEntry(args->GetMethodParameters()); |
| 159 | args->SetMethodReturn(nullptr); |
| 160 | }); |
| 161 | prov_resp->AddInput("type", glib2::DataType::DBus<ClientAttentionType>()); |
| 162 | prov_resp->AddInput("group", glib2::DataType::DBus<ClientAttentionGroup>()); |
| 163 | prov_resp->AddInput("id", glib2::DataType::DBus<uint32_t>()); |
| 164 | prov_resp->AddInput("value", glib2::DataType::DBus<std::string>()); |
| 165 | } |
| 166 | |