# ukui-menu-extensions

Plugin extensions for the UKUI desktop menu, providing additional functional modules.

## Extensions

| Extension | Package | Description |
|-----------|---------|-------------|
| **ernie-bot** | `ukui-menu-ernie-bot` | AI assistant integrating ERNIE Bot conversational capabilities with session management and message interaction |
| **recent-file** | `ukui-menu-recent-file` | Recently accessed files display, supporting quick open and context menu operations |

## Dependencies

- CMake >= 3.16
- Qt 6 (Core, Gui, Quick, Widgets, Network, DBus, LinguistTools) or Qt 5
- libukui-menu-dev (UKUI menu plugin framework)
- libukui-quick-dev (>= 4.20.8.0)
- libglib2.0-dev
- libkysdk-base-dev, libkysdk-system-dev
- libqt6xdg-dev (Qt6 XDG toolkit)
- pkgconf

## Build

```bash
mkdir build && cd build
cmake ..
make -j$(nproc)
sudo make install
```

Build a single extension:

```bash
cmake -DBUILD_TEST=OFF ..
make -j$(nproc) ernie-bot
# or
make -j$(nproc) recent-file
```

### Build with tests

```bash
cmake -DBUILD_TEST=ON ..
make -j$(nproc)
```

## Install Paths

| File | Path |
|------|------|
| Plugin libraries | `/usr/lib/<arch>/ukui-menu/extensions/` |
| Translation files | `/usr/share/ukui-menu/extensions/translations/` |

## Internationalization

The project supports multiple languages via Qt Linguist. Each extension contains its own translation files.

Supported languages: Simplified Chinese, Traditional Chinese (Hong Kong), Traditional Chinese, Arabic, Tibetan, German, Spanish, French, Kazakh, Kyrgyz, Mongolian, Uyghur, Vietnamese.

## Project Structure

```
ukui-menu-extensions/
├── CMakeLists.txt              # Top-level build configuration
├── LICENSE                     # GPL-3.0 license
├── README_EN.md
├── debian/                     # Debian packaging files
├── ernie-bot/                  # AI assistant extension
│   ├── CMakeLists.txt
│   ├── content/                # QML UI and icon resources
│   │   ├── icon/
│   │   └── ui/                 # QML interface files
│   ├── src/                    # C++ source code
│   │   ├── ernie-bot.h/cpp     # Plugin entry point
│   │   ├── chat.h/cpp          # Chat management
│   │   ├── session.h/cpp       # Session
│   │   ├── session-manager.h/cpp
│   │   ├── message*.h/cpp      # Message model and actions
│   │   └── metadata.json       # Plugin metadata
│   ├── test/                   # Test code
│   └── translations/           # Translation files
└── recent-file/                # Recent file extension
    ├── CMakeLists.txt
    ├── recent-file-extension.h/cpp
    ├── event-track.h/cpp       # Event tracking
    ├── metadata.json           # Plugin metadata
    └── translations/           # Translation files
```

## Development Interface

Extensions are built on the UKUI menu plugin framework (`libukui-menu-dev`) and implement the following interfaces:

- `UkuiMenu::MenuExtensionPlugin` — Plugin registration entry, registered via `Q_PLUGIN_METADATA`
- `UkuiMenu::WidgetExtension` — Provides UI components and data interaction
- `UkuiMenu::ContextMenuExtension` — Provides context menu extensions

## License

[GPL-3.0-or-later](LICENSE)
